2 #include <score/command/Dispatchers/SettingsCommandDispatcher.hpp>
3 #include <score/tools/Bind.hpp>
7 #include <score_lib_base_export.h>
11 template <
class Model>
12 class SettingsDelegateView;
13 class SettingsDelegateModel;
15 template <
class Model>
28 virtual void on_accept() { m_disp.commit(); }
30 virtual void on_reject() { m_disp.rollback(); }
32 virtual QString settingsName() = 0;
33 virtual QIcon settingsIcon() = 0;
38 return static_cast<typename T::model_type&
>(
self->m_model);
44 return static_cast<typename T::view_type&
>(
self->m_view);
58 #define DEFERRED_SETTINGS_PRESENTER(Control) \
61 con(v, &View::Control##Changed, this, [&](auto val) { \
62 if(val != m.get##Control()) \
64 m_disp.submitDeferredCommand<SetModel##Control>(this->model(this), val); \
68 con(m, &Model::Control##Changed, &v, &View::set##Control); \
69 v.set##Control(m.get##Control()); \
72 #define SETTINGS_PRESENTER(Control) \
75 con(v, &View::Control##Changed, this, [&](auto val) { \
76 if(val != m.get##Control()) \
78 m_disp.submit<SetModel##Control>(this->model(this), val); \
82 con(m, &Model::Control##Changed, &v, &View::set##Control); \
83 v.set##Control(m.get##Control()); \
Definition: SettingsCommandDispatcher.hpp:10
Definition: SettingsDelegatePresenter.hpp:17
Definition: SettingsDelegateView.hpp:18
Base toolkit upon which the software is built.
Definition: Application.cpp:90