|
QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
A node representing an entry in a QgsRuntimeProfiler. More...
#include <qgsruntimeprofiler.h>
Public Types | |
| enum | Roles { Name = Qt::UserRole + 1, Group, Elapsed, ParentElapsed } |
| Custom node data roles. More... | |
Public Member Functions | |
| QgsRuntimeProfilerNode (const QgsRuntimeProfilerNode &other)=delete | |
| QgsRuntimeProfilerNode cannot be copied. More... | |
| QgsRuntimeProfilerNode (const QString &group, const QString &name) | |
| Constructor for QgsRuntimeProfilerNode, with the specified group and name. More... | |
| ~QgsRuntimeProfilerNode () | |
| void | addChild (std::unique_ptr< QgsRuntimeProfilerNode > child) |
| Adds a child node to this node. More... | |
| QgsRuntimeProfilerNode * | child (const QString &group, const QString &name) |
| Finds the child with matching group and name. More... | |
| QgsRuntimeProfilerNode * | childAt (int index) |
| Returns the child at the specified index. More... | |
| int | childCount () const |
| Returns the number of child nodes owned by this node. More... | |
| void | clear () |
| Clears the node, removing all its children. More... | |
| QVariant | data (int role=Qt::DisplayRole) const |
| Returns the node's data for the specified model role. More... | |
| double | elapsed () const |
| Returns the node's elapsed time, in seconds. More... | |
| QStringList | fullParentPath () const |
| Returns the full path to the node's parent. More... | |
| int | indexOf (QgsRuntimeProfilerNode *child) const |
| Returns the index of the specified child node. More... | |
| QgsRuntimeProfilerNode & | operator= (const QgsRuntimeProfilerNode &other)=delete |
| QgsRuntimeProfilerNode cannot be copied. More... | |
| QgsRuntimeProfilerNode * | parent () |
| Returns the node's parent node. More... | |
| void | removeChildAt (int index) |
| Removes and deletes the child at the specified index. More... | |
| void | setElapsed (double time) |
| Manually sets the node's elapsed time, in seconds. More... | |
| void | start () |
| Starts the node timer. More... | |
| void | stop () |
| Stops the node's timer, recording the elapsed time automatically. More... | |
| double | totalElapsedTimeForChildren (const QString &group) const |
| Returns the total elapsed time in seconds for all children of this node with matching group. More... | |
A node representing an entry in a QgsRuntimeProfiler.
Definition at line 39 of file qgsruntimeprofiler.h.
Custom node data roles.
| Enumerator | |
|---|---|
| Name | Profile item name. |
| Group | Node group. |
| Elapsed | Node elapsed time. |
| ParentElapsed | Total elapsed time for node's parent. |
Definition at line 44 of file qgsruntimeprofiler.h.
| QgsRuntimeProfilerNode::QgsRuntimeProfilerNode | ( | const QString & | group, |
| const QString & | name | ||
| ) |
Constructor for QgsRuntimeProfilerNode, with the specified group and name.
Definition at line 29 of file qgsruntimeprofiler.cpp.
|
delete |
QgsRuntimeProfilerNode cannot be copied.
|
default |
| void QgsRuntimeProfilerNode::addChild | ( | std::unique_ptr< QgsRuntimeProfilerNode > | child | ) |
Adds a child node to this node.
Definition at line 72 of file qgsruntimeprofiler.cpp.
| QgsRuntimeProfilerNode * QgsRuntimeProfilerNode::child | ( | const QString & | group, |
| const QString & | name | ||
| ) |
Finds the child with matching group and name.
Returns nullptr if a matching child was not found.
Definition at line 95 of file qgsruntimeprofiler.cpp.
| QgsRuntimeProfilerNode * QgsRuntimeProfilerNode::childAt | ( | int | index | ) |
Returns the child at the specified index.
Definition at line 105 of file qgsruntimeprofiler.cpp.
|
inline |
Returns the number of child nodes owned by this node.
Definition at line 84 of file qgsruntimeprofiler.h.
| void QgsRuntimeProfilerNode::clear | ( | ) |
Clears the node, removing all its children.
Definition at line 111 of file qgsruntimeprofiler.cpp.
| QVariant QgsRuntimeProfilerNode::data | ( | int | role = Qt::DisplayRole | ) | const |
Returns the node's data for the specified model role.
Definition at line 51 of file qgsruntimeprofiler.cpp.
| double QgsRuntimeProfilerNode::elapsed | ( | ) | const |
Returns the node's elapsed time, in seconds.
If the node is still running then 0 will be returned.
Definition at line 137 of file qgsruntimeprofiler.cpp.
| QStringList QgsRuntimeProfilerNode::fullParentPath | ( | ) | const |
Returns the full path to the node's parent.
Definition at line 38 of file qgsruntimeprofiler.cpp.
| int QgsRuntimeProfilerNode::indexOf | ( | QgsRuntimeProfilerNode * | child | ) | const |
Returns the index of the specified child node.
Definition at line 83 of file qgsruntimeprofiler.cpp.
|
delete |
QgsRuntimeProfilerNode cannot be copied.
|
inline |
Returns the node's parent node.
If parent is nullptr, the node is a root node
Definition at line 69 of file qgsruntimeprofiler.h.
| void QgsRuntimeProfilerNode::removeChildAt | ( | int | index | ) |
Removes and deletes the child at the specified index.
Definition at line 116 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfilerNode::setElapsed | ( | double | time | ) |
Manually sets the node's elapsed time, in seconds.
Definition at line 132 of file qgsruntimeprofiler.cpp.
| void QgsRuntimeProfilerNode::start | ( | ) |
| void QgsRuntimeProfilerNode::stop | ( | ) |
Stops the node's timer, recording the elapsed time automatically.
Definition at line 127 of file qgsruntimeprofiler.cpp.
| double QgsRuntimeProfilerNode::totalElapsedTimeForChildren | ( | const QString & | group | ) | const |
Returns the total elapsed time in seconds for all children of this node with matching group.
Definition at line 142 of file qgsruntimeprofiler.cpp.