Move call to SetLabel after base-class create so that flags have been set

This commit is contained in:
Graham Dawes
2019-07-17 08:29:25 +01:00
parent 785103493c
commit a1d8a6a244

View File

@@ -47,7 +47,6 @@ bool wxStaticText::Create(wxWindow *parent,
const wxString &name) const wxString &name)
{ {
m_qtLabel = new wxQtStaticText( parent, this ); 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 // 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: // any unwanted side effects, so disable the interaction:
@@ -64,7 +63,12 @@ bool wxStaticText::Create(wxWindow *parent,
else else
m_qtLabel->setAlignment(Qt::AlignLeft); 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) void wxStaticText::SetLabel(const wxString& label)