Remove QInputContext usage from QWidget test
Change-Id: Ifcd600f5efd5bd079dd2f8d66803e34ffa6df37f Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
This commit is contained in:
parent
a3a0b03735
commit
711f367d8f
@ -56,7 +56,6 @@
|
|||||||
#include <qstyle.h>
|
#include <qstyle.h>
|
||||||
#include <qwidget.h>
|
#include <qwidget.h>
|
||||||
#include <qwindowsstyle.h>
|
#include <qwindowsstyle.h>
|
||||||
#include <qinputcontext.h>
|
|
||||||
#include <qdesktopwidget.h>
|
#include <qdesktopwidget.h>
|
||||||
#include <private/qwidget_p.h>
|
#include <private/qwidget_p.h>
|
||||||
#include <private/qapplication_p.h>
|
#include <private/qapplication_p.h>
|
||||||
@ -8994,15 +8993,11 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
|
|||||||
void tst_QWidget::inputFocus_task257832()
|
void tst_QWidget::inputFocus_task257832()
|
||||||
{
|
{
|
||||||
QLineEdit *widget = new QLineEdit;
|
QLineEdit *widget = new QLineEdit;
|
||||||
QInputContext *context = widget->inputContext();
|
|
||||||
if (!context)
|
|
||||||
QSKIP("No input context");
|
|
||||||
widget->setFocus();
|
widget->setFocus();
|
||||||
widget->winId(); // make sure, widget has been created
|
widget->winId(); // make sure, widget has been created
|
||||||
context->setFocusWidget(widget);
|
QCOMPARE(qApp->inputPanel()->inputItem(), static_cast<QWidget*>(widget));
|
||||||
QCOMPARE(context->focusWidget(), static_cast<QWidget*>(widget));
|
|
||||||
widget->setReadOnly(true);
|
widget->setReadOnly(true);
|
||||||
QVERIFY(!context->focusWidget());
|
QVERIFY(!qApp->inputPanel()->inputItem());
|
||||||
delete widget;
|
delete widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9137,24 +9132,19 @@ void tst_QWidget::focusProxyAndInputMethods()
|
|||||||
// and that the input method gets the focus proxy passed
|
// and that the input method gets the focus proxy passed
|
||||||
// as the focus widget instead of the child widget.
|
// as the focus widget instead of the child widget.
|
||||||
// otherwise input method queries go to the wrong widget
|
// otherwise input method queries go to the wrong widget
|
||||||
QInputContext *inputContext = qApp->inputContext();
|
QCOMPARE(qApp->inputPanel()->inputItem(), toplevel);
|
||||||
if (inputContext) {
|
|
||||||
QCOMPARE(inputContext->focusWidget(), toplevel);
|
|
||||||
|
|
||||||
child->setAttribute(Qt::WA_InputMethodEnabled, false);
|
child->setAttribute(Qt::WA_InputMethodEnabled, false);
|
||||||
QVERIFY(!inputContext->focusWidget());
|
QVERIFY(!qApp->inputPanel()->inputItem());
|
||||||
|
|
||||||
child->setAttribute(Qt::WA_InputMethodEnabled, true);
|
child->setAttribute(Qt::WA_InputMethodEnabled, true);
|
||||||
QCOMPARE(inputContext->focusWidget(), toplevel);
|
QCOMPARE(qApp->inputPanel()->inputItem(), toplevel);
|
||||||
|
|
||||||
child->setEnabled(false);
|
child->setEnabled(false);
|
||||||
QVERIFY(!inputContext->focusWidget());
|
QVERIFY(!qApp->inputPanel()->inputItem());
|
||||||
|
|
||||||
child->setEnabled(true);
|
child->setEnabled(true);
|
||||||
QCOMPARE(inputContext->focusWidget(), toplevel);
|
QCOMPARE(qApp->inputPanel()->inputItem(), toplevel);
|
||||||
} else {
|
|
||||||
qDebug() << "No input context set, skipping QInputContext::focusWidget() test";
|
|
||||||
}
|
|
||||||
|
|
||||||
delete toplevel;
|
delete toplevel;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user