From adee46d155a581076879345cdca75871c8b7906f Mon Sep 17 00:00:00 2001 From: Matthew Griffin <45285214+matthew-griffin@users.noreply.github.com> Date: Wed, 23 Jan 2019 11:04:31 +0000 Subject: [PATCH] Send event when wxSpinCtrlDouble value changes in wxQt Closes https://github.com/wxWidgets/wxWidgets/pull/1168 --- src/qt/spinctrl.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index a782d30906..5ea0ff9787 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -162,9 +162,25 @@ class wxQtDoubleSpinBox : public wxQtSpinBoxBase< QDoubleSpinBox > public: wxQtDoubleSpinBox( wxWindow *parent, wxControl *handler ) : wxQtSpinBoxBase< QDoubleSpinBox >( parent, handler ) - { } + { + connect(this, static_cast(&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 ); + } +} + //##############################################################################