diff options
-rw-r--r-- | src/corelib/global/qnamespace.h | 1 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 9 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index fa3d5913b5..ab83730caa 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -513,6 +513,7 @@ public: AA_DisableShaderDiskCache = 27, AA_DontShowShortcutsInContextMenus = 28, AA_CompressTabletEvents = 29, + AA_DisableWindowContextHelpButton = 30, // ### Qt 6: remove me // Add new attributes before this line AA_AttributeCount diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 4ddb89014e..93f468f64b 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -275,6 +275,12 @@ \e glProgramBinary(). In the unlikely event of this being problematic, set this attribute to disable all disk-based caching of shaders. + \value AA_DisableWindowContextHelpButton Disables the WindowContextHelpButtonHint + by default on Qt::Sheet and Qt::Dialog widgets. This hides the \gui ? button + on Windows, which only makes sense if you use \l QWhatsThis functionality. + This value has been added in Qt 5.10. For Qt 6, WindowContextHelpButtonHint + will not be set by default. + The following values are obsolete: \value AA_ImmediateWidgetCreation This attribute is no longer fully diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 4dcee2771b..7b9ccf3837 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1117,9 +1117,12 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) } if (customize) ; // don't modify window flags if the user explicitly set them. - else if (type == Qt::Dialog || type == Qt::Sheet) - flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; - else if (type == Qt::Tool) + else if (type == Qt::Dialog || type == Qt::Sheet) { + flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; + // ### fixme: Qt 6: Never set Qt::WindowContextHelpButtonHint flag automatically + if (!QApplicationPrivate::testAttribute(Qt::AA_DisableWindowContextHelpButton)) + flags |= Qt::WindowContextHelpButtonHint; + } else if (type == Qt::Tool) flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; else flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | |