QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
QgsHistoryEntryNode Class Referenceabstract

Base class for nodes representing a QgsHistoryEntry. More...

#include <qgshistoryentrynode.h>

Inheritance diagram for QgsHistoryEntryNode:
Inheritance graph
[legend]

Public Member Functions

 QgsHistoryEntryNode ()=default
 
 QgsHistoryEntryNode (const QgsHistoryEntryNode &other)=delete
 
virtual ~QgsHistoryEntryNode ()
 
virtual int childCount () const
 Returns the number of child nodes owned by this node.
 
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.
 
QgsHistoryEntryNodeoperator= (const QgsHistoryEntryNode &other)=delete
 
QgsHistoryEntryGroupparent ()
 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.
 

Friends

class QgsHistoryEntryGroup
 

Detailed Description

Base class for nodes representing a QgsHistoryEntry.

Since
QGIS 3.32

Definition at line 39 of file qgshistoryentrynode.h.

Constructor & Destructor Documentation

◆ QgsHistoryEntryNode() [1/2]

QgsHistoryEntryNode::QgsHistoryEntryNode ( )
default

◆ ~QgsHistoryEntryNode()

QgsHistoryEntryNode::~QgsHistoryEntryNode ( )
virtualdefault

◆ QgsHistoryEntryNode() [2/2]

QgsHistoryEntryNode::QgsHistoryEntryNode ( const QgsHistoryEntryNode other)
delete

Member Function Documentation

◆ childCount()

int QgsHistoryEntryNode::childCount ( ) const
virtual

Returns the number of child nodes owned by this node.

Reimplemented in QgsHistoryEntryGroup.

Definition at line 24 of file qgshistoryentrynode.cpp.

◆ createWidget()

QWidget * QgsHistoryEntryNode::createWidget ( const QgsHistoryWidgetContext context)
virtual

Returns a new widget which should be shown to users when selecting the node.

If a nullptr is returned, the node's html() method will be called instead to create the node's content.

See also
html()

Definition at line 34 of file qgshistoryentrynode.cpp.

◆ data()

virtual QVariant QgsHistoryEntryNode::data ( int  role = Qt::DisplayRole) const
pure virtual

Returns the node's data for the specified model role.

◆ doubleClicked()

bool QgsHistoryEntryNode::doubleClicked ( const QgsHistoryWidgetContext context)
virtual

Called when the node is double-clicked.

The default implementation does nothing.

Returns true if the node handled the double-click event and it should not be further processed.

Definition at line 39 of file qgshistoryentrynode.cpp.

◆ html()

QString QgsHistoryEntryNode::html ( const QgsHistoryWidgetContext context) const
virtual

Returns a HTML formatted text string which should be shown to a user when selecting the node.

Subclasses should implement this method or createWidget(), but not both.

See also
createWidget()

Definition at line 29 of file qgshistoryentrynode.cpp.

◆ matchesString()

bool QgsHistoryEntryNode::matchesString ( const QString &  searchString) const
virtual

Returns true if the node matches the specified searchString, and should be shown in filtered results with that search string.

The default implementation returns true if the string is contained within the node's DisplayRole.

Definition at line 49 of file qgshistoryentrynode.cpp.

◆ operator=()

QgsHistoryEntryNode & QgsHistoryEntryNode::operator= ( const QgsHistoryEntryNode other)
delete

◆ parent()

QgsHistoryEntryGroup * QgsHistoryEntryNode::parent ( )
inline

Returns the node's parent node.

If parent is nullptr, the node is a root node.

Definition at line 54 of file qgshistoryentrynode.h.

◆ populateContextMenu()

void QgsHistoryEntryNode::populateContextMenu ( QMenu *  menu,
const QgsHistoryWidgetContext context 
)
virtual

Allows the node to populate a context menu before display to the user.

Actions should be parented to the specified menu.

Definition at line 44 of file qgshistoryentrynode.cpp.

Friends And Related Symbol Documentation

◆ QgsHistoryEntryGroup

friend class QgsHistoryEntryGroup
friend

Definition at line 117 of file qgshistoryentrynode.h.


The documentation for this class was generated from the following files: