|
8 | 8 |
|
9 | 9 | #include <iostream> |
10 | 10 |
|
11 | | -using QtNodes::PortType; |
12 | | -using QtNodes::PortIndex; |
13 | 11 | using QtNodes::NodeData; |
14 | 12 | using QtNodes::NodeDelegateModel; |
| 13 | +using QtNodes::PortIndex; |
| 14 | +using QtNodes::PortType; |
15 | 15 |
|
16 | 16 | class QTextEdit; |
17 | 17 |
|
18 | 18 | /// The model dictates the number of inputs and outputs for the Node. |
19 | 19 | /// In this example it has no logic. |
20 | 20 | class TextModel : public NodeDelegateModel |
21 | 21 | { |
22 | | - Q_OBJECT |
| 22 | + Q_OBJECT |
23 | 23 |
|
24 | 24 | public: |
25 | | - TextModel(); |
| 25 | + TextModel(); |
26 | 26 |
|
27 | 27 | public: |
28 | | - QString |
29 | | - caption() const override |
30 | | - { return QString("Text"); } |
| 28 | + QString caption() const override { return QString("Text"); } |
31 | 29 |
|
32 | | - bool |
33 | | - captionVisible() const override { return true; } |
| 30 | + bool captionVisible() const override { return true; } |
34 | 31 |
|
35 | | - static QString |
36 | | - Name() |
37 | | - { return QString("TextModel"); } |
| 32 | + static QString Name() { return QString("TextModel"); } |
38 | 33 |
|
39 | | - QString |
40 | | - name() const override |
41 | | - { return TextModel::Name(); } |
| 34 | + QString name() const override { return TextModel::Name(); } |
42 | 35 |
|
43 | 36 | public: |
44 | | - unsigned int |
45 | | - nPorts(PortType portType) const override; |
| 37 | + unsigned int nPorts(PortType portType) const override; |
46 | 38 |
|
47 | | - NodeDataType |
48 | | - dataType(PortType portType, PortIndex portIndex) const override; |
| 39 | + NodeDataType dataType(PortType portType, PortIndex portIndex) const override; |
49 | 40 |
|
50 | | - std::shared_ptr<NodeData> |
51 | | - outData(PortIndex const portIndex) override; |
| 41 | + std::shared_ptr<NodeData> outData(PortIndex const portIndex) override; |
52 | 42 |
|
53 | | - void |
54 | | - setInData(std::shared_ptr<NodeData>, PortIndex const) override; |
| 43 | + void setInData(std::shared_ptr<NodeData>, PortIndex const) override; |
55 | 44 |
|
56 | | - QWidget * |
57 | | - embeddedWidget() override; |
| 45 | + QWidget *embeddedWidget() override; |
58 | 46 |
|
59 | | - bool |
60 | | - resizable() const override { return true; } |
| 47 | + bool resizable() const override { return true; } |
61 | 48 |
|
62 | 49 | private Q_SLOTS: |
63 | 50 |
|
64 | | - void |
65 | | - onTextEdited(); |
| 51 | + void onTextEdited(); |
66 | 52 |
|
67 | 53 | private: |
68 | | - QTextEdit * _textEdit = nullptr; |
| 54 | + QTextEdit *_textEdit = nullptr; |
69 | 55 | }; |
0 commit comments