Send event when wxSpinCtrlDouble value changes in wxQt

Closes https://github.com/wxWidgets/wxWidgets/pull/1168
This commit is contained in:
Matthew Griffin 2019-01-23 11:04:31 +00:00 committed by Vadim Zeitlin
parent 7cfb5b91a5
commit adee46d155

View File

@ -162,9 +162,25 @@ class wxQtDoubleSpinBox : public wxQtSpinBoxBase< QDoubleSpinBox >
public:
wxQtDoubleSpinBox( wxWindow *parent, wxControl *handler )
: wxQtSpinBoxBase< QDoubleSpinBox >( parent, handler )
{ }
{
connect(this, static_cast<void (QDoubleSpinBox::*)(double value)>(&QDoubleSpinBox::valueChanged),
this, &wxQtDoubleSpinBox::valueChanged);
}
private:
void valueChanged(double value);
};
void wxQtDoubleSpinBox::valueChanged(double value)
{
wxControl *handler = GetHandler();
if ( handler )
{
wxSpinDoubleEvent event( wxEVT_SPINCTRLDOUBLE, handler->GetId() );
event.SetValue(value);
EmitEvent( event );
}
}
//##############################################################################