diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-09-13 10:26:03 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-09-13 10:46:16 (GMT) |
commit | 06dc8791a70329dc8e985a0eed7e434d1f762ec5 (patch) | |
tree | f3a9f55307207088676d4c48ec67ec418fa56053 /tests/auto/qwidget | |
parent | 59a2ff150795e1281e6b4fea435e74d3434a5ad2 (diff) | |
parent | 31cc0b1820c0c8fdfdbc3d5b804f2dba2051c96f (diff) | |
download | Qt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.zip Qt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.tar.gz Qt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.tar.bz2 |
Merge remote branch 'qt/master' into lighthouse-master
Conflicts:
configure
src/corelib/global/qglobal.h
src/corelib/tools/qsimd.cpp
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index fc22058..cdd0d80 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -402,6 +402,8 @@ private slots: #endif // QT_MAC_USE_COCOA #endif + void nativeChildFocus(); + private: bool ensureScreenSize(int width, int height); QWidget *testWidget; @@ -10521,5 +10523,28 @@ void tst_QWidget::taskQTBUG_11373() #endif // QT_MAC_USE_COCOA #endif +void tst_QWidget::nativeChildFocus() +{ + QWidget w; + QLayout *layout = new QVBoxLayout; + w.setLayout(layout); + QLineEdit *p1 = new QLineEdit; + QLineEdit *p2 = new QLineEdit; + layout->addWidget(p1); + layout->addWidget(p2); + p1->setObjectName("p1"); + p2->setObjectName("p2"); + w.show(); + w.activateWindow(); + p1->setFocus(); + p1->setAttribute(Qt::WA_NativeWindow); + p2->setAttribute(Qt::WA_NativeWindow); + QApplication::processEvents(); + QTest::qWaitForWindowShown(&w); + + QCOMPARE(QApplication::activeWindow(), &w); + QCOMPARE(QApplication::focusWidget(), p1); +} + QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc" |