From a1d8a6a244929131ed135d4fb989487d1f79d658 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 17 Jul 2019 08:29:25 +0100 Subject: [PATCH] Move call to SetLabel after base-class create so that flags have been set --- src/qt/stattext.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qt/stattext.cpp b/src/qt/stattext.cpp index 3d3be67e96..1aaa885277 100644 --- a/src/qt/stattext.cpp +++ b/src/qt/stattext.cpp @@ -47,7 +47,6 @@ bool wxStaticText::Create(wxWindow *parent, const wxString &name) { m_qtLabel = new wxQtStaticText( parent, this ); - SetLabel(label); // Set the buddy to itself to get the mnemonic key but ensure that we don't have // any unwanted side effects, so disable the interaction: @@ -64,7 +63,12 @@ bool wxStaticText::Create(wxWindow *parent, else m_qtLabel->setAlignment(Qt::AlignLeft); - return QtCreateControl( parent, id, pos, size, style, wxDefaultValidator, name ); + if ( !QtCreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) + return false; + + SetLabel(label); + + return true; } void wxStaticText::SetLabel(const wxString& label)