2 #include <score/command/Command.hpp>
3 #include <score/model/path/Path.hpp>
4 #include <score/model/path/PathSerialization.hpp>
23 using Command::Command;
26 template <
typename T,
typename... Args>
28 : m_path{
Path<T>(obj).unsafePath()}
29 , m_property{std::move(property)}
30 , m_old{obj.property(m_property.toUtf8().constData())}
31 , m_new{std::move(newval)}
40 template <
typename Path_T>
41 void update(
const Path_T&, QVariant newval)
43 m_new = std::move(newval);
53 QVariant m_old, m_new;
60 using model_t =
typename T::model_type;
61 using param_t =
typename T::param_type;
66 using score::Command::Command;
72 , m_old{(obj.*T::get)()}
73 , m_new{std::forward<U>(newval)}
79 template <
typename Path_T,
typename U>
80 void update(
const Path_T&, U&& newval)
82 m_new = std::forward<U>(newval);
87 (m_path.find(ctx).*T::set)(m_old);
92 (m_path.find(ctx).*T::set)(m_new);
98 s << m_path << m_old << m_new;
103 s >> m_path >> m_old >> m_new;
107 param_t m_old, m_new;
110 template <
typename T>
117 #define PROPERTY_COMMAND_T(NS, Name, Property, Description) \
120 class Name : public score::PropertyCommand_T<Property> \
122 SCORE_COMMAND_DECL(NS::CommandFactoryName(), Name, Description) \
124 using PropertyCommand_T::PropertyCommand_T; \
132 struct score::PropertyCommand_T<NS::Property>::command<void> \
134 using type = NS::Name; \
The ObjectPath class.
Definition: ObjectPath.hpp:37
The Command class.
Definition: Command.hpp:34
Definition: PropertyCommand.hpp:58
The PropertyCommand class.
Definition: PropertyCommand.hpp:21
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DataStreamHelpers.hpp:103
Definition: DocumentContext.hpp:18
Definition: PropertyCommand.hpp:64
Definition: PropertyCommand.hpp:112