diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2013-01-24 16:41:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-02 10:52:56 +0100 |
commit | 8c8e9f59bcbf6ce394b9ae081988f3d294438acd (patch) | |
tree | a2a06b9191c2720f41248a3ce619ec12ccdfdc09 | |
parent | a496b5dc38c96465e6ea4750ef293d8f2c3b6fc5 (diff) |
showIsFullscreen: only respect this hint for windows and dialogs
If the window or widget is a popup, ignore the hint. The
intention of the flag should be to show main windows etc in
fullscreen, and not all kinds of popups and tooltips. The user can always
call showFullscreen explicit when necessary.
This is a backport of 48c73540ad2a507963db0fba57484faf66462ad7.
We need it in stable to fix menus on BlackBerry platform, they're
appearing fullscreen.
Task-number: QTBUG-29969
Change-Id: Id0d6cfc194916aa7f993cde54b5a0002f60399e1
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 8 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 2a2e30634a..f4a2059d74 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1449,13 +1449,15 @@ QObject *QWindow::focusObject() const Shows the window. This equivalent to calling showFullScreen() or showNormal(), depending - on whether the platform defaults to windows being fullscreen or not. + on whether the platform defaults to windows being fullscreen or not, and + whether the window is a popup. - \sa showFullScreen(), showNormal(), hide(), QStyleHints::showIsFullScreen() + \sa showFullScreen(), showNormal(), hide(), QStyleHints::showIsFullScreen(), flags() */ void QWindow::show() { - if (qApp->styleHints()->showIsFullScreen()) + bool isPopup = d_func()->windowFlags & Qt::Popup & ~Qt::Window; + if (!isPopup && qApp->styleHints()->showIsFullScreen()) showFullScreen(); else showNormal(); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 5ec713140e..f82d33f283 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6916,14 +6916,15 @@ void QWidget::setUpdatesEnabled(bool enable) Shows the widget and its child widgets. This function is equivalent to setVisible(true) in the normal case, and equivalent to showFullScreen() if the QStyleHints::showIsFullScreen() hint - is true. + is true and the window is not a popup. \sa raise(), showEvent(), hide(), setVisible(), showMinimized(), showMaximized(), - showNormal(), isVisible() + showNormal(), isVisible(), windowFlags() */ void QWidget::show() { - if (isWindow() && qApp->styleHints()->showIsFullScreen()) + bool isPopup = data->window_flags & Qt::Popup & ~Qt::Window; + if (isWindow() && !isPopup && qApp->styleHints()->showIsFullScreen()) showFullScreen(); else setVisible(true); |