summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qcombobox
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-02-29 00:57:12 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-02-29 00:58:13 +0100
commitc4ad58ed2252d5ed9f448a5c068ab33dce4cadd9 (patch)
tree7e9802171d7b4c641c2de1ef781023cab5d7d14c /tests/auto/widgets/widgets/qcombobox
parent7da3a61b5fd5cc726f8fd62691aa5f84c7929800 (diff)
parentfa1b9070af66edb81b2a3735c1951f78b22bd666 (diff)
Merge remote-tracking branch 'gerrit/master' into containers
Diffstat (limited to 'tests/auto/widgets/widgets/qcombobox')
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index 907a239912..0fe93995a1 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -43,6 +43,8 @@
#include "qcombobox.h"
#include <private/qcombobox_p.h>
+#include <private/qguiapplication_p.h>
+#include <qplatformtheme_qpa.h>
#include <qfontcombobox.h>
#include <qdesktopwidget.h>
@@ -1915,19 +1917,15 @@ void tst_QComboBox::itemListPosition()
QWidget topLevel;
QFontComboBox combo(&topLevel);
- //the code to get the avaialbe screen space is copied from QComboBox code
+ //the code to get the available screen space is copied from QComboBox code
const int scrNumber = QApplication::desktop()->screenNumber(&combo);
- QRect screen;
-#ifdef Q_WS_WIN
- screen = QApplication::desktop()->screenGeometry(scrNumber);
-#elif defined Q_WS_X11
- if (X11->desktopEnvironment == DE_KDE)
- screen = QApplication::desktop()->screenGeometry(scrNumber);
- else
- screen = QApplication::desktop()->availableGeometry(scrNumber);
-#else
- screen = QApplication::desktop()->availableGeometry(scrNumber);
-#endif
+
+ bool useFullScreenForPopupMenu = false;
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
+ useFullScreenForPopupMenu = theme->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool();
+ const QRect screen = useFullScreenForPopupMenu ?
+ QApplication::desktop()->screenGeometry(scrNumber) :
+ QApplication::desktop()->availableGeometry(scrNumber);
combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo to the top-right corner