Merge branch 'qt_fix_button_crash' of https://github.com/GeoTeric/wxWidgets
Fix crashes when loading wxButton from XRC in wxQt See https://github.com/wxWidgets/wxWidgets/pull/1091
This commit is contained in:
commit
54f96392be
@ -18,9 +18,7 @@ class QPushButton;
|
||||
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
|
||||
{
|
||||
public:
|
||||
wxAnyButton()
|
||||
{
|
||||
}
|
||||
wxAnyButton();
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
@ -46,6 +46,12 @@ void wxQtPushButton::clicked( bool WXUNUSED(checked) )
|
||||
}
|
||||
}
|
||||
|
||||
wxAnyButton::wxAnyButton() :
|
||||
m_qtPushButton(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void wxAnyButton::QtCreate(wxWindow *parent)
|
||||
{
|
||||
// create the default push button (used in button and bmp button)
|
||||
@ -56,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user