2 #include <score/command/Dispatchers/SingleOngoingCommandDispatcher.hpp>
3 #include <score/widgets/SignalUtils.hpp>
12 template <
typename Property,
typename Command,
typename SpinBox>
15 using model_type =
typename Property::model_type;
22 m_sb->setMaximum(20000);
24 connect(m_sb, SignalUtils::SpinBox_valueChanged<SpinBox>(),
this, [&](
int h) {
25 if(h != (model.*Property::get())())
27 m_slotDisp.submit(model, h);
30 connect(m_sb, &SpinBox::editingFinished,
this, [=] { m_slotDisp.commit(); });
32 con(model, Property::notify(),
this, [=](
auto val) {
33 if(val != m_sb->value())
39 m_sb->setValue((model.*Property::get())());
42 auto widget()
const {
return m_sb; }
The SingleOngoingCommandDispatcher class.
Definition: SingleOngoingCommandDispatcher.hpp:17
A small abstraction layer over the score::CommandStack.
Definition: CommandStackFacade.hpp:20
The SpinBox class.
Definition: SpinBoxes.hpp:68
Base toolkit upon which the software is built.
Definition: Application.cpp:90
CommandSpinbox Will update a value of the model according to the spinbox.
Definition: CommandSpinBox.hpp:14