diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-06-05 14:50:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-05 15:42:01 +0200 |
commit | 1df0f4b2af84ec503c86b72b05490942f04e541f (patch) | |
tree | afe1af39e8bdcfb3ba454516cad745bb6512951f | |
parent | b73ad2dd197c5f35817bb33db17777596671478b (diff) |
Fix tst_qcombobox::itemListPosition.
Add font combo to top level via layout and position top level
instead of the (child) font combo.
Change-Id: I0f754c37c009d1ed83615b800d6f2467e858c047
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 36b83eefda..0bfd4baa0c 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -2044,10 +2044,11 @@ void tst_QComboBox::itemListPosition() //we test QFontComboBox because it has the specific behaviour to set a fixed size //to the list view QWidget topLevel; - topLevel.resize(200, 200); - topLevel.move(100, 100); + QHBoxLayout *layout = new QHBoxLayout(&topLevel); + QFontComboBox combo(&topLevel); + layout->addWidget(&combo); //the code to get the available screen space is copied from QComboBox code const int scrNumber = QApplication::desktop()->screenNumber(&combo); @@ -2058,11 +2059,12 @@ void tst_QComboBox::itemListPosition() QApplication::desktop()->screenGeometry(scrNumber) : QApplication::desktop()->availableGeometry(scrNumber); - combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo to the top-right corner + topLevel.move(screen.width() - topLevel.sizeHint().width() - 10, 0); //puts the combo to the top-right corner topLevel.show(); + //wait because the window manager can move the window if there is a right panel - QTRY_VERIFY(combo.isVisible()); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); combo.showPopup(); QTRY_VERIFY(combo.view()); QTRY_VERIFY(combo.view()->isVisible()); |