QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
Base class for history entry "group" nodes, which contain children of their own. More...
#include <qgshistoryentrynode.h>
Public Member Functions | |
QgsHistoryEntryGroup ()=default | |
QgsHistoryEntryGroup (const QgsHistoryEntryGroup &other)=delete | |
~QgsHistoryEntryGroup () override | |
void | addChild (QgsHistoryEntryNode *child) |
Adds a child node to this node. | |
QgsHistoryEntryNode * | childAt (int index) |
Returns the child at the specified index. | |
int | childCount () const FINAL |
Returns the number of child nodes owned by this node. | |
void | clear () |
Clears the group, removing all its children. | |
int | indexOf (QgsHistoryEntryNode *child) const |
Returns the index of the specified child node. | |
void | insertChild (int index, QgsHistoryEntryNode *child) |
Inserts a child node at the specified index. | |
QgsHistoryEntryGroup & | operator= (const QgsHistoryEntryGroup &other)=delete |
void | removeChildAt (int index) |
Removes the child at the specified index. | |
Public Member Functions inherited from QgsHistoryEntryNode | |
QgsHistoryEntryNode ()=default | |
QgsHistoryEntryNode (const QgsHistoryEntryNode &other)=delete | |
virtual | ~QgsHistoryEntryNode () |
virtual QWidget * | createWidget (const QgsHistoryWidgetContext &context) |
Returns a new widget which should be shown to users when selecting the node. | |
virtual QVariant | data (int role=Qt::DisplayRole) const =0 |
Returns the node's data for the specified model role. | |
virtual bool | doubleClicked (const QgsHistoryWidgetContext &context) |
Called when the node is double-clicked. | |
virtual QString | html (const QgsHistoryWidgetContext &context) const |
Returns a HTML formatted text string which should be shown to a user when selecting the node. | |
virtual bool | matchesString (const QString &searchString) const |
Returns true if the node matches the specified searchString, and should be shown in filtered results with that search string. | |
QgsHistoryEntryNode & | operator= (const QgsHistoryEntryNode &other)=delete |
QgsHistoryEntryGroup * | parent () |
Returns the node's parent node. | |
virtual void | populateContextMenu (QMenu *menu, const QgsHistoryWidgetContext &context) |
Allows the node to populate a context menu before display to the user. | |
Protected Attributes | |
std::deque< std::unique_ptr< QgsHistoryEntryNode > > | mChildren |
Base class for history entry "group" nodes, which contain children of their own.
Definition at line 128 of file qgshistoryentrynode.h.
|
default |
|
overridedefault |
|
delete |
void QgsHistoryEntryGroup::addChild | ( | QgsHistoryEntryNode * | child | ) |
Adds a child node to this node.
Ownership is transferred to the group.
Definition at line 64 of file qgshistoryentrynode.cpp.
QgsHistoryEntryNode * QgsHistoryEntryGroup::childAt | ( | int | index | ) |
Returns the child at the specified index.
Definition at line 100 of file qgshistoryentrynode.cpp.
|
virtual |
Returns the number of child nodes owned by this node.
Reimplemented from QgsHistoryEntryNode.
Definition at line 122 of file qgshistoryentrynode.cpp.
void QgsHistoryEntryGroup::clear | ( | ) |
Clears the group, removing all its children.
Definition at line 117 of file qgshistoryentrynode.cpp.
int QgsHistoryEntryGroup::indexOf | ( | QgsHistoryEntryNode * | child | ) | const |
Returns the index of the specified child node.
Definition at line 86 of file qgshistoryentrynode.cpp.
void QgsHistoryEntryGroup::insertChild | ( | int | index, |
QgsHistoryEntryNode * | child | ||
) |
Inserts a child node at the specified index.
Ownership is transferred to the group.
Definition at line 75 of file qgshistoryentrynode.cpp.
|
delete |
void QgsHistoryEntryGroup::removeChildAt | ( | int | index | ) |
Removes the child at the specified index.
Definition at line 109 of file qgshistoryentrynode.cpp.
|
protected |
Definition at line 177 of file qgshistoryentrynode.h.