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:
parent
f4d93e5afd
commit
79bae5fe1d
2 changed files with 6 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ public:
|
|||
// --------------
|
||||
|
||||
virtual void SetLabel( const wxString &label ) override;
|
||||
virtual wxString GetLabel() const override;
|
||||
|
||||
virtual QWidget *GetHandle() const override;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue