wxQt: wxAnyButton should override GetLabel() too

wxAnyButton already overrides SetLabel(), but not GetLabel()
in which case an empty string will be returned if we try to call it
because the base class version is trying to return the window title
instead of the window text/label and this is obviously wrong.
This commit is contained in:
ali kettab 2022-10-28 23:09:06 +01:00
parent f4d93e5afd
commit 79bae5fe1d
2 changed files with 6 additions and 0 deletions

View file

@ -24,6 +24,7 @@ public:
// --------------
virtual void SetLabel( const wxString &label ) override;
virtual wxString GetLabel() const override;
virtual QWidget *GetHandle() const override;

View file

@ -115,6 +115,11 @@ void wxAnyButton::SetLabel( const wxString &label )
m_qtPushButton->setText( wxQtConvertString( label ));
}
wxString wxAnyButton::GetLabel() const
{
return wxQtConvertString( m_qtPushButton->text() );
}
QWidget *wxAnyButton::GetHandle() const
{
return m_qtPushButton;