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
This commit is contained in:
Graham Dawes
2019-07-03 10:39:10 +01:00
committed by Vadim Zeitlin
parent ab553cd6db
commit 07c6c61b2c

View File

@@ -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;