PortSource.hpp
1 #pragma once
2 #include <QPointer>
3 #include <QQmlProperty>
4 #include <QQmlPropertyValueSource>
5 
6 #include <verdigris>
7 
8 namespace Process
9 {
10 class ControlInlet;
11 }
12 
13 namespace JS
14 {
15 
16 struct PortSource
17  : public QObject
18  , public QQmlPropertyValueSource
19 {
20  W_OBJECT(PortSource)
21  W_INTERFACE(QQmlPropertyValueSource)
22  QML_ELEMENT
23 
24 public:
25  explicit PortSource(QObject* parent = nullptr);
26  ~PortSource();
27 
28  void setTarget(const QQmlProperty& prop) override;
29  void on_newUIValue();
30  W_SLOT(on_newUIValue);
31 
32  INLINE_PROPERTY_CREF(QString, process, = "", process, setProcess, processChanged)
33  INLINE_PROPERTY_CREF(QVariant, port, = "", port, setPort, portChanged)
34 
35 private:
36  void rebuild();
37  QQmlProperty m_targetProperty;
38  QPointer<Process::ControlInlet> m_inlet{};
39 };
40 
41 }
Definition: QmlObjects.hpp:114
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: PortSource.hpp:19