2#include <ossia/network/base/parameter.hpp>
4#include <ossia-qt/device/qml_node_base.hpp>
5#include <ossia-qt/qml_context.hpp>
6#include <ossia-qt/value_metatypes.hpp>
9#include <QQmlExpression>
10#include <QQmlProperty>
11#include <QQmlPropertyValueSource>
12#include <QQmlScriptString>
21class qml_property_context :
public QObject
23 W_OBJECT(qml_property_context)
28 QQmlProperty& targetProperty;
32 void qtVariantChanged();
33 W_SLOT(qtVariantChanged);
36class qml_property_reader
37 :
public qml_node_base
38 ,
public QQmlPropertyValueSource
40 W_OBJECT(qml_property_reader)
41 W_INTERFACE(QQmlPropertyValueSource)
44 qml_property_reader(QQuickItem* parent =
nullptr);
45 ~qml_property_reader()
override;
47 void setTarget(
const QQmlProperty& prop)
override;
48 void setDevice(QObject* device)
override;
49 void resetNode()
override;
52 void setupAddress(
bool reading);
56 QQmlProperty m_targetProperty;
58 qml_property_context* m_propCtx{};
61class qml_property_writer
62 :
public qml_node_base
63 ,
public QQmlPropertyValueSource
65 W_OBJECT(qml_property_writer)
66 W_INTERFACE(QQmlPropertyValueSource)
69 qml_property_writer(QQuickItem* parent =
nullptr);
70 ~qml_property_writer()
override;
72 void setTarget(
const QQmlProperty& prop)
override;
73 void setDevice(QObject* device)
override;
74 void resetNode()
override;
77 void setValue_sig(
const value& arg_1) E_SIGNAL(OSSIA_EXPORT, setValue_sig, arg_1);
80 void setValue_slot(
const value&);
81 W_SLOT(setValue_slot);
84 void setupAddress(
bool reading);
88 QQmlProperty m_targetProperty;
90 ossia::net::parameter_base::iterator m_cb;
93class qml_binding :
public qml_node_base
98 qml_binding(QQuickItem* parent =
nullptr);
99 ~qml_binding()
override;
101 void setDevice(QObject* device)
override;
102 void resetNode()
override;
104 QQmlScriptString on()
const;
107 void setOn(QQmlScriptString on);
111 void onChanged(QQmlScriptString on) E_SIGNAL(OSSIA_EXPORT, onChanged, on);
117 std::unique_ptr<QQmlExpression> m_expr;
119 QQmlScriptString m_on;
121 W_PROPERTY(QQmlScriptString, on READ on WRITE setOn NOTIFY onChanged)
124class qml_callback :
public qml_node_base
126 W_OBJECT(qml_callback)
129 qml_callback(QQuickItem* parent =
nullptr);
130 ~qml_callback()
override;
132 void setDevice(QObject* device)
override;
133 void resetNode()
override;
135 QVariant value()
const;
138 void valueChanged(QVariant arg_1) E_SIGNAL(OSSIA_EXPORT, valueChanged, arg_1);
140 E_SIGNAL(OSSIA_EXPORT, setValue_sig, arg_1);
143 void setValue(QVariant value);
146 W_SLOT(setValue_slot);
154 ossia::net::parameter_base::iterator m_cb;
156 W_PROPERTY(QVariant, value READ value WRITE setValue NOTIFY valueChanged)
161W_REGISTER_ARGTYPE(QQmlScriptString)
The node_base class.
Definition node.hpp:48
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The value class.
Definition value.hpp:173