Skui 0.0.1
Build fast and easy to use control software with Skui.
 
Loading...
Searching...
No Matches
node.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <QHash>
4#include <QObject>
5#include <QPoint>
6#include <QVariant>
7
8#include "interface.hpp"
9
10class Node : public QObject
11{
12 Q_OBJECT
13 Q_PROPERTY(QString name MEMBER m_name)
14 Q_PROPERTY(QPoint position_hint READ positionHint WRITE setPositionHint NOTIFY
15 positionHintChanged MEMBER m_position_hint)
16
17public:
18 explicit Node(QObject *parent);
19
20 void setInterfaces(const QList<Interface> &interfaces) { m_interfaces = interfaces; }
29 QList<Interface> &getInterfaces() { return m_interfaces; }
30
40 Interface *getInterface(const QString &identifier);
41
50 const virtual bool isVisual() const { return false; }
51
60 QPoint positionHint() const { return m_position_hint; }
61
70 void setPositionHint(QPoint position_hint);
71
72signals:
78
84
85protected:
92 void config();
93
94private:
95 QWidget *m_nodeeditor = nullptr;
96
97 // Properties
98 QString m_name = "Undefined";
99 QPoint m_position_hint = QPoint(0, 0);
100
101 QList<Interface> m_interfaces;
102 static QMap<QString, int> instance_counter;
103};
Definition interface.hpp:9
void setInterfaces(const QList< Interface > &interfaces)
Definition node.hpp:20
QPoint position_hint
Definition node.hpp:15
void setPositionHint(QPoint position_hint)
Set the position hint.
Definition node.cpp:34
Interface * getInterface(const QString &identifier)
Get an interface by its identifier.
Definition node.cpp:9
QPoint positionHint() const
Get the position hint.
Definition node.hpp:60
void config()
Set various configurations.
Definition node.cpp:20
QList< Interface > & getInterfaces()
Get the list of interfaces.
Definition node.hpp:29
void positionHintChanged(const QPoint position_hint)
void changedInterfaceValue(const Interface &)
QString name
Definition node.hpp:13
Node(QObject *parent)
Definition node.cpp:5
virtual const bool isVisual() const
Checks if the node is a visual node.
Definition node.hpp:50