diff options
author | Kai Koehne <kai.koehne@qt.io> | 2016-10-11 11:24:37 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2016-10-17 13:31:53 +0000 |
commit | 9d696af6cd45ee95c155829999b8184229f9bc72 (patch) | |
tree | 1830188e4c39bfcd21312a269f6adc4c131786d2 /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | 063997f44ffc1b6650ef6d67832674d5511fdb63 (diff) |
Disable WindowsContextHelpButtonHint for Dialogs that are not QWidget
Do not set WindowsContextHelpButtonHint directly in Windows QPA plugin,
but instead rely on logic in QWidgetPrivate::adjustFlags for widgets.
If WindowsContextHelpButtonHint is set, a '?' button is shown in the
windows decoration. If pressed, an EnterWhatsThisMode event is generated
that is consumed in QApplication that then calls into the QWhatsThis
singleton, which changes the mouse cursor, and informs the top-level
QWidgets about the state change etc.
For QGuiApplications though the event is not generated, which makes the
button useless by default. In addition, QWhatsThis only works with top
level QWidgets, not e.g. QQuickWindows. So for apps using QApplication
and QtQuick.Controls this means that the "What's this mode" is never
exited.
Given that the paradigm is somewhat outdated on the desktop it is unlikely
that Qt Quick Controls will implement support for What's this. Anyhow,
QWidgetPrivate::adjustFlags sets the hint for Qt::Dialogs, too,
so there's no need to set it the Windows QPA plugin.
[ChangeLog][Windows] 'What's this' button is now shown by default
only for QWidget dialogs.
Task-number: QTBUG-56239
Change-Id: I1ea3e92ade723b5865c8f2e19674413433658942
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 7289f8de6d..0ebed59a1d 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -424,11 +424,9 @@ static inline void fixTopLevelWindowFlags(Qt::WindowFlags &flags) |Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint; break; case Qt::Dialog: - flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; - break; case Qt::Tool: - flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; - break; + flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; + break; default: break; } |