Fix for NULL pixmap when setting button icon in wxQT

This commit is contained in:
Graham Dawes
2018-12-20 10:33:01 +00:00
parent bc4d3a4554
commit 57b636b2d4

View File

@@ -62,8 +62,11 @@ void wxAnyButton::QtSetBitmap( const wxBitmap &bitmap )
{
// load the bitmap and resize the button:
QPixmap *pixmap = bitmap.GetHandle();
m_qtPushButton->setIcon( QIcon( *pixmap ));
m_qtPushButton->setIconSize( pixmap->rect().size() );
if ( pixmap != NULL )
{
m_qtPushButton->setIcon(QIcon(*pixmap));
m_qtPushButton->setIconSize(pixmap->rect().size());
}
m_bitmap = bitmap;
}