summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-12 19:17:07 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-12 19:17:07 +0200
commite2776b44a0e0e34e5a1d851916a94f7db5e7bb7b (patch)
tree7c428c524aa1b8cc42d3a581a8c13378ebd341b5 /tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
parent5c8aa27111fd51c8dff78fd0a276648aea08d4c1 (diff)
parentaf2f1e14f61ee8d3a4ade723aed9618d1707f975 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/plugins/platforms/cocoa/qcocoamenubar.mm Change-Id: I4a699fc8a7f30b2af9de8e496c3d5f027b7495bb
Diffstat (limited to 'tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp')
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp10
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 2ca42e3d08..f26af0e1f4 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -2045,10 +2045,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);
@@ -2059,11 +2060,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());