Send event when wxSpinCtrlDouble value changes in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1168
This commit is contained in:
parent
7cfb5b91a5
commit
adee46d155
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//##############################################################################
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user