50 if (
string.isEmpty() )
53 return data( Qt::DisplayRole ).toString().contains(
string, Qt::CaseInsensitive );
68 Q_ASSERT( !child->mParent );
69 child->mParent =
this;
79 Q_ASSERT( !child->mParent );
80 child->mParent =
this;
82 mChildren.insert(
mChildren.begin() + index, std::unique_ptr<QgsHistoryEntryNode>( child ) );
87 if ( child->mParent !=
this )
90 auto it = std::find_if(
mChildren.begin(),
mChildren.end(), [&](
const std::unique_ptr<QgsHistoryEntryNode> &p ) {
91 return p.get() == child;
94 return static_cast<int>( std::distance(
mChildren.begin(), it ) );
100 if (
static_cast<std::size_t
>( index ) >=
mChildren.size() )
108 if (
static_cast<std::size_t
>( index ) >=
mChildren.size() )
121 return static_cast<int>(
mChildren.size() );
void addChild(QgsHistoryEntryNode *child)
Adds a child node to this node.
void removeChildAt(int index)
Removes the child at the specified index.
~QgsHistoryEntryGroup() override
int childCount() const FINAL
Returns the number of child nodes owned by this node.
QgsHistoryEntryNode * childAt(int index)
Returns the child at the specified index.
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.
void clear()
Clears the group, removing all its children.
std::deque< std::unique_ptr< QgsHistoryEntryNode > > mChildren
Base class for nodes representing a QgsHistoryEntry.
virtual QWidget * createWidget(const QgsHistoryWidgetContext &context)
Returns a new widget which should be shown to users when selecting the node.
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 ~QgsHistoryEntryNode()
virtual bool matchesString(const QString &searchString) const
Returns true if the node matches the specified searchString, and should be shown in filtered results ...
virtual QVariant data(int role=Qt::DisplayRole) const =0
Returns the node's data for the specified model role.
virtual void populateContextMenu(QMenu *menu, const QgsHistoryWidgetContext &context)
Allows the node to populate a context menu before display to the user.
virtual int childCount() const
Returns the number of child nodes owned by this node.
virtual bool doubleClicked(const QgsHistoryWidgetContext &context)
Called when the node is double-clicked.
Contains settings which reflect the context in which a history widget is shown, e....