Fix for NULL pixmap when setting button icon in wxQT
This commit is contained in:
@@ -62,8 +62,11 @@ void wxAnyButton::QtSetBitmap( const wxBitmap &bitmap )
|
|||||||
{
|
{
|
||||||
// load the bitmap and resize the button:
|
// load the bitmap and resize the button:
|
||||||
QPixmap *pixmap = bitmap.GetHandle();
|
QPixmap *pixmap = bitmap.GetHandle();
|
||||||
|
if ( pixmap != NULL )
|
||||||
|
{
|
||||||
m_qtPushButton->setIcon(QIcon(*pixmap));
|
m_qtPushButton->setIcon(QIcon(*pixmap));
|
||||||
m_qtPushButton->setIconSize(pixmap->rect().size());
|
m_qtPushButton->setIconSize(pixmap->rect().size());
|
||||||
|
}
|
||||||
|
|
||||||
m_bitmap = bitmap;
|
m_bitmap = bitmap;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user