Fix bitmap accessor for the buttons in wxQt
Return the bitmap previously set with SetBitmap(). This fixes unit tests using GetBitmap(). Closes https://github.com/wxWidgets/wxWidgets/pull/1035
This commit is contained in:
committed by
Vadim Zeitlin
parent
29f771ab82
commit
5e089badc0
@@ -58,6 +58,8 @@ void wxAnyButton::QtSetBitmap( const wxBitmap &bitmap )
|
||||
QPixmap *pixmap = bitmap.GetHandle();
|
||||
m_qtPushButton->setIcon( QIcon( *pixmap ));
|
||||
m_qtPushButton->setIconSize( pixmap->rect().size() );
|
||||
|
||||
m_bitmap = bitmap;
|
||||
}
|
||||
|
||||
void wxAnyButton::SetLabel( const wxString &label )
|
||||
@@ -70,6 +72,11 @@ QWidget *wxAnyButton::GetHandle() const
|
||||
return m_qtPushButton;
|
||||
}
|
||||
|
||||
wxBitmap wxAnyButton::DoGetBitmap(State state) const
|
||||
{
|
||||
return state == State_Normal ? m_bitmap : wxNullBitmap;
|
||||
}
|
||||
|
||||
void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which)
|
||||
{
|
||||
switch ( which )
|
||||
|
||||
Reference in New Issue
Block a user