diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-21 09:11:27 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-08 18:44:59 +0000 |
commit | 3a34ef636af43e249fba417419db14c42b98094a (patch) | |
tree | e5165267a4b48b7f3abebe408ab5e9122f094ec0 /src/widgets/widgets/qcombobox.cpp | |
parent | 8045ccc382ac91c14849e10f37d9a8d0605dc562 (diff) |
QMenu/QComboBox: Extract helper for determining the pop up geometry
Move the code returning whether a popup should use the full
screen to QStylePrivate and use for QMenu and QComboBox.
Task-number: QTBUG-73231
Change-Id: I1901ecedfa90edf16329ce3b13ef4abea5ab44e8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index e20a0892b4..bdd2462c92 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -80,6 +80,7 @@ #if QT_CONFIG(effects) # include <private/qeffects_p.h> #endif +#include <private/qstyle_p.h> #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif @@ -261,16 +262,11 @@ void QComboBoxPrivate::_q_modelDestroyed() model = QAbstractItemModelPrivate::staticEmptyModel(); } - -//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't QRect QComboBoxPrivate::popupGeometry(int screen) const { - bool useFullScreenForPopupMenu = false; - if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) - useFullScreenForPopupMenu = theme->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool(); - return useFullScreenForPopupMenu ? - QDesktopWidgetPrivate::screenGeometry(screen) : - QDesktopWidgetPrivate::availableGeometry(screen); + return QStylePrivate::useFullScreenForPopup() + ? QDesktopWidgetPrivate::screenGeometry(screen) + : QDesktopWidgetPrivate::availableGeometry(screen); } bool QComboBoxPrivate::updateHoverControl(const QPoint &pos) |