From 07c6c61b2c59a39ae4e0e677043925c5abd825b6 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 3 Jul 2019 10:39:10 +0100 Subject: [PATCH] Don't show context help button by default in wxQt dialogs Only show it if wxDIALOG_EX_CONTEXTHELP was explicitly specified for consistency with the other ports. Closes https://github.com/wxWidgets/wxWidgets/pull/1382 --- src/qt/dialog.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/qt/dialog.cpp b/src/qt/dialog.cpp index f19fd41f63..fc9fcaba4f 100644 --- a/src/qt/dialog.cpp +++ b/src/qt/dialog.cpp @@ -59,7 +59,16 @@ bool wxDialog::Create( wxWindow *parent, wxWindowID id, // all dialogs should have tab traversal enabled style |= wxTAB_TRAVERSAL; - m_qtWindow = new wxQtDialog( parent, this ); + m_qtWindow = new wxQtDialog(parent, this); + + // Qt adds the context help button by default and we need to explicitly + // remove it to avoid having it if it's not explicitly requested. + if ( !HasExtraStyle(wxDIALOG_EX_CONTEXTHELP) ) + { + Qt::WindowFlags qtFlags = m_qtWindow->windowFlags(); + qtFlags &= ~Qt::WindowContextHelpButtonHint; + m_qtWindow->setWindowFlags(qtFlags); + } if ( !wxTopLevelWindow::Create( parent, id, title, pos, size, style, name ) ) return false;