The Document class represents a document in the application. More...
#include <document.hpp>
Public Member Functions | |
| Document (QObject *parent=nullptr) | |
| ~Document () | |
| Panel * | panel () const |
| Returns the panel of the document. | |
| NodeEditor * | nodeEditor () const |
| Returns the node editor of the document. | |
| QList< QString > | availableNodes () const |
| Returns the list of available node types. | |
| void | createNode (const QString &name, const QPoint position_hint=QPoint(0, 0)) |
| Creates a node of the specified type. | |
| void | deleteNode (Node *node) |
Static Public Member Functions | |
| static Document * | activeDocument () |
| Returns the active document. | |
The Document class represents a document in the application.
It manages the node editor and panel for the document. The Document class also provides methods to create visual nodes and access the available node types. There is always one active document in the application, which can be accessed via the static method activeDocument().
| Document::Document | ( | QObject * | parent = nullptr | ) |
| Document::~Document | ( | ) |
|
inlinestatic |
Returns the active document.
This method returns a pointer to the active document. The active document is the document that is currently being edited.
| QList< QString > Document::availableNodes | ( | ) | const |
Returns the list of available node types.
This method returns a list of strings representing the types of nodes that can be created.
| void Document::createNode | ( | const QString & | name, |
| const QPoint | position_hint = QPoint(0, 0) ) |
Creates a node of the specified type.
This method creates a node of the specified type by the name and adds it to the node editor.
| name | The type of the node to create. |
| void Document::deleteNode | ( | Node * | node | ) |
|
inline |
Returns the node editor of the document.
This method returns a pointer to the node editor of the document.
|
inline |
Returns the panel of the document.
This method returns a pointer to the panel of the document.