|
Envision
A visual programming IDE for object-oriented languages
|
An InfoNode is the base class of all nodes which display some sort of information on a target node. More...
Classes | |
| struct | InfoGetterStruct |
Public Types | |
| using | InfoGetter = QString(*)(Model::Node *target) |
Public Member Functions | |
| InfoNode (Model::Node *target) | |
| InfoNode (Model::Node *target, QJsonArray enabledInfos) | |
| virtual | ~InfoNode () |
| virtual void | automaticUpdate () |
| Updates the InfoNode automatically, meaning it only updates the results from the info getters which are set to update automatically. More... | |
| virtual void | fullUpdate () |
| Updates the InfoNode fully, meaning it gets the result from all info getters. More... | |
| QString | infoHtml () const |
| If the infos can be represented as a string, use this to represent them as HTML text. More... | |
| bool | isEnabled (const QString name) const |
| Returns whether the info getter with the given name is enabled for this node. More... | |
| void | move (const QString &name, bool moveUp) |
| Move an info getter up or down in the node. More... | |
| void | setEnabled (const QString name, bool isEnabled) |
| Enable or disable the info getter identified by the given name. More... | |
| const Model::Node * | target () const |
| virtual QJsonValue | toJson () const override |
Static Public Member Functions | |
| static QStringList | registeredInfoGetters () |
| Returns a list with the names of all registered info getters. More... | |
| static void | registerInfoGetter (const QString &name, const InfoGetter getter, bool updatesAutomatically, bool enabledByDefault) |
| Registers a new method to get information. More... | |
Protected Member Functions | |
| void | setInfoHtml (QString content) |
| virtual void | updateInfo (bool isAutoUpdate) |
| Updates the node's stored information. More... | |
Private Attributes | |
| QHash< QString, QString > | cachedInfoStrings_ |
| QList< QString > | enabledInfoGetters_ |
| QString | infoHtml_ |
| Model::Node * | target_ {} |
Static Private Attributes | |
| static QHash< QString, InfoGetterStruct > | allInfoGetters |
| static QList< InfoNode * > | allInfoNodes |
Additional Inherited Members | |
Protected Types inherited from Core::Reflect< Base > | |
| using | Super = Reflect< Base > |
An InfoNode is the base class of all nodes which display some sort of information on a target node.
There is a registry which keeps track of all possible informations to be displayed.
| using Visualization::InfoNode::InfoGetter = QString (*) (Model::Node* target) |
| Visualization::InfoNode::InfoNode | ( | Model::Node * | target | ) |
| Visualization::InfoNode::InfoNode | ( | Model::Node * | target, |
| QJsonArray | enabledInfos | ||
| ) |
|
virtual |
|
inlinevirtual |
Updates the InfoNode automatically, meaning it only updates the results from the info getters which are set to update automatically.
|
inlinevirtual |
Updates the InfoNode fully, meaning it gets the result from all info getters.
|
inline |
If the infos can be represented as a string, use this to represent them as HTML text.
Then the same visualization can be used for multiple statistics nodes.
|
inline |
Returns whether the info getter with the given name is enabled for this node.
| void Visualization::InfoNode::move | ( | const QString & | name, |
| bool | moveUp | ||
| ) |
Move an info getter up or down in the node.
|
inlinestatic |
Returns a list with the names of all registered info getters.
|
static |
Registers a new method to get information.
| name | The name of the getter. |
| getter | The getter method itself, taking a node and returning a string. If this method is not applicable for the node supplied, it should return an empty string. |
| updatesAutomatically | Whether this info should always update. |
| enabledByDefault | Whether this info is visible by default. |
| void Visualization::InfoNode::setEnabled | ( | const QString | name, |
| bool | isEnabled | ||
| ) |
Enable or disable the info getter identified by the given name.
|
protected |
|
inline |
|
overridevirtual |
|
protectedvirtual |
Updates the node's stored information.
| isAutoUpdate | Is this an automatic update, or a forced update? A forced update will update everything. |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |