2#include <ossia/editor/expression/expression_generic.hpp>
5#include <QQmlExpression>
6#include <QQmlListProperty>
7#include <QQmlScriptString>
21 qml_expr(QQmlExpression* e)
26 void update()
override { }
27 bool evaluate()
const override {
return m_expr->evaluate().toBool(); }
28 void on_first_callback_added(expressions::expression_generic&)
override { }
29 void on_removing_last_callback(expressions::expression_generic&)
override { }
32 std::unique_ptr<QQmlExpression> m_expr;
36make_expression(
const QQmlScriptString& script, QObject* obj, expression_ptr deflt);
37class qml_cond :
public QQuickItem
42 qml_cond(QQuickItem* parent =
nullptr);
46 QQmlScriptString expr()
const;
47 qml_sync* sync()
const;
51 void registerState(qml_state*);
52 void unregisterState(qml_state*);
54 std::shared_ptr<ossia::time_event> cond()
const {
return m_impl; }
55 void setCond(std::shared_ptr<ossia::time_event> c) { m_impl = c; }
58 void setExpr(QQmlScriptString expr);
60 void setSync(qml_sync* sync);
64 void exprChanged(QQmlScriptString expr) E_SIGNAL(OSSIA_EXPORT, exprChanged, expr);
65 void syncChanged(qml_sync* sync) E_SIGNAL(OSSIA_EXPORT, syncChanged, sync);
69 QQmlScriptString m_expr;
70 std::shared_ptr<ossia::time_event> m_impl;
73 W_PROPERTY(qml_sync*, sync READ sync WRITE setSync NOTIFY syncChanged)
75 W_PROPERTY(QQmlScriptString, expr READ expr WRITE setExpr NOTIFY exprChanged)
Definition expression_generic.hpp:13