Reuse Qt implementation of normal button for toggle buttons

This commit is contained in:
Cătălin Răceanu
2019-02-13 01:23:20 +02:00
parent 7be9c8c670
commit be9c18cbd6
5 changed files with 29 additions and 35 deletions

View File

@@ -40,12 +40,16 @@ wxQtPushButton::wxQtPushButton(wxWindow *parent, wxAnyButton *handler)
connect(this, &QPushButton::released, this, &wxQtPushButton::action);
}
void wxQtPushButton::clicked( bool WXUNUSED(checked) )
void wxQtPushButton::clicked(bool checked)
{
wxAnyButton *handler = GetHandler();
if ( handler )
{
wxCommandEvent event( wxEVT_BUTTON, handler->GetId() );
wxCommandEvent event( handler->GetEventType(), handler->GetId() );
if ( isCheckable() ) // toggle buttons
{
event.SetInt(checked);
}
EmitEvent( event );
}
}