From 9d696af6cd45ee95c155829999b8184229f9bc72 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 11 Oct 2016 11:24:37 +0200 Subject: Disable WindowsContextHelpButtonHint for Dialogs that are not QWidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/windows/qwindowswindow.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') 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; } -- cgit v1.2.3