diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-03 12:59:23 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-09 09:35:23 +0200 |
commit | c9b2528a9d60561e3050a3dadd86b893cd35349d (patch) | |
tree | 98b9166fb5b781b5d834d18b3af76a70bf3dfe7d /src/widgets/kernel | |
parent | b75c82f6456edbc00646da15531cfb63f8957817 (diff) |
Don't set WindowContextHelpButtonHint by default for dialogs and sheets
This makes the Qt::AA_DisableWindowContextHelpButton flag obsolete. It
is already documented as such in Qt 5, so we can remove it now.
[ChangeLog][QtWidgets] Do not show 'What's this' button anymore in
dialogs on Windows. To show the button again, you need to set
Qt::WindowsContextHelpButtonHint explicitly the top level widget.
Change-Id: I30017ca300441cb2ee37940ce97dfe18eb2b118b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 7be83c1837..08479a4a37 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -967,18 +967,11 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) flags |= Qt::WindowSystemMenuHint; flags |= Qt::WindowTitleHint; } - if (customize) - ; // don't modify window flags if the user explicitly set them. - else if (type == Qt::Dialog || type == Qt::Sheet) { + if (!customize) { // don't modify window flags if the user explicitly set them. 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 | - Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; + if (type != Qt::Dialog && type != Qt::Sheet && type != Qt::Tool) + flags |= Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowFullscreenButtonHint; + } if (w->testAttribute(Qt::WA_TransparentForMouseEvents)) flags |= Qt::WindowTransparentForInput; } |