diff options
author | Matthew Cattell <matthew.cattell@nokia.com> | 2011-09-22 17:31:52 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-22 17:38:24 +0200 |
commit | d535e1f4159767584e1c22a9db308c6b5d8c4b2c (patch) | |
tree | f91d52166d22bbb10ef5103086c474e6d6914404 /tests/auto | |
parent | 33c3525e38580a8333d86316ad79952359d4ac31 (diff) |
partial build fix replaced QApplication::setActiveWindow with requestActivateWindow and added widgets-private
Change-Id: I6e2a3b51c10684de974a0954ca4182860d351eef
Reviewed-on: http://codereview.qt-project.org/5403
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qsgtextedit/qsgtextedit.pro | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/declarative/qsgtextedit/qsgtextedit.pro b/tests/auto/declarative/qsgtextedit/qsgtextedit.pro index 4e233f3a10..1048e499d9 100644 --- a/tests/auto/declarative/qsgtextedit/qsgtextedit.pro +++ b/tests/auto/declarative/qsgtextedit/qsgtextedit.pro @@ -1,5 +1,5 @@ load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui network +contains(QT_CONFIG,declarative): QT += declarative gui network widgets widgets-private macx:CONFIG -= app_bundle SOURCES += tst_qsgtextedit.cpp ../shared/testhttpserver.cpp diff --git a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp index 7c0f097358..0fc2a1a509 100644 --- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp +++ b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp @@ -567,9 +567,9 @@ void tst_qsgtextedit::hAlign_RightToLeft() QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignLeft); QVERIFY(textEdit->positionToRectangle(0).x() < canvas.width()/2); - QApplication::setActiveWindow(&canvas); + canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); - QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&canvas)); + QTRY_COMPARE(QGuiApplication::activeWindow(), &canvas); textEdit->setText(QString()); { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(&canvas, &ev); } @@ -1933,6 +1933,7 @@ public: if (event->type() == QEvent::CloseSoftwareInputPanel) closeInputPanelReceived = true; return QInputContext::filterEvent(event); + } void update() { updateReceived = true; } @@ -2005,7 +2006,7 @@ void tst_qsgtextedit::openInputPanelOnClick() view.show(); qApp->setAutoSipEnabled(true); - QApplication::setActiveWindow(&view); + view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view)); @@ -2056,7 +2057,7 @@ void tst_qsgtextedit::openInputPanelOnFocus() view.show(); qApp->setAutoSipEnabled(true); - QApplication::setActiveWindow(&view); + view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view)); @@ -2299,7 +2300,7 @@ void tst_qsgtextedit::preeditMicroFocus() view.setInputContext(&ic); view.setAttribute(Qt::WA_InputMethodEnabled, false); view.show(); - QApplication::setActiveWindow(&view); + view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view)); @@ -2362,7 +2363,7 @@ void tst_qsgtextedit::inputContextMouseHandler() view.setInputContext(&ic); view.setAttribute(Qt::WA_InputMethodEnabled, false); view.show(); - QApplication::setActiveWindow(&view); + view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view)); @@ -2474,7 +2475,7 @@ void tst_qsgtextedit::inputMethodComposing() QSGView view(QUrl::fromLocalFile(SRCDIR "/data/inputContext.qml")); view.show(); - QApplication::setActiveWindow(&view); + view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view)); QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject()); @@ -2511,7 +2512,7 @@ void tst_qsgtextedit::cursorRectangleSize() QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->setFocus(); - QApplication::setActiveWindow(canvas); + canvas->requestActivateWindow(); QTest::qWaitForWindowShown(canvas); QSGTextEdit *textEdit = qobject_cast<QSGTextEdit *>(canvas->rootObject()); |