Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
bookmarkitem.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef BOOKMARKITEM_H
5#define BOOKMARKITEM_H
6
7#include <QtCore/QVariant>
8#include <QtCore/QList>
9
11
12enum {
13 UserRoleUrl = Qt::UserRole + 50,
14 UserRoleFolder = Qt::UserRole + 100,
15 UserRoleExpanded = Qt::UserRole + 150
16};
17
19
21{
22public:
23 explicit BookmarkItem(const DataVector &data, BookmarkItem *parent = nullptr);
24 ~BookmarkItem();
25
26 BookmarkItem *parent() const;
27 void setParent(BookmarkItem *parent);
28
29 void addChild(BookmarkItem *child);
30 BookmarkItem *child(int number) const;
31
32 int childCount() const;
33 int childNumber() const;
34
35 QVariant data(int column) const;
36 void setData(const DataVector &data);
37 bool setData(int column, const QVariant &value);
38
39 bool insertChildren(bool isFolder, int position, int count);
40 bool removeChildren(int position, int count);
41
42 void dumpTree(int indent) const;
43
44private:
45 DataVector m_data;
46
47 BookmarkItem *m_parent;
48 QList<BookmarkItem*> m_children;
49};
50
51QT_END_NAMESPACE
52
53#endif // BOOKMARKITEM_H
QList< QPersistentModelIndex > PersistentModelIndexCache
@ UserRoleExpanded
@ UserRoleFolder
@ UserRoleUrl
QList< QVariant > DataVector
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
~BookmarkDialog() override
Qt::DropActions supportedDropActions() const override
QModelIndex mapToSource(const QModelIndex &proxyIndex) const override
Reimplement this function to return the model index in the source model that corresponds to the proxy...
QVariant data(const QModelIndex &index, int role) const override
Returns the data stored under the given role for the item referred to by the index.
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Sets the role data for the item at index to value.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns the item flags for the given index.
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override
Reimplement this function to return the model index in the proxy model that corresponds to the source...
QModelIndex index(int row, int column, const QModelIndex &parent) const override
Returns the index of the item in the model specified by the given row, column and parent index.
int rowCount(const QModelIndex &index) const override
Returns the number of rows under the given parent.
int columnCount(const QModelIndex &index) const override
Returns the number of columns for the children of the given parent.
QModelIndex parent(const QModelIndex &child) const override
void setSourceModel(QAbstractItemModel *sourceModel) override
Sets the given sourceModel to be processed by the proxy model.
QVariant data(int column) const
BookmarkItem * child(int number) const
bool insertChildren(bool isFolder, int position, int count)
void addChild(BookmarkItem *child)
void setParent(BookmarkItem *parent)
bool setData(int column, const QVariant &value)
bool removeChildren(int position, int count)
int childCount() const
BookmarkItem * parent() const
void setData(const DataVector &data)
BookmarkItem(const DataVector &data, BookmarkItem *parent=nullptr)
int childNumber() const
void dumpTree(int indent) const
void setItemsEditable(bool editable)
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Returns true if the item in the row indicated by the given source_row and source_parent should be inc...
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns for the children of the given parent.
static HelpEngineWrapper & instance()
Combined button and popup list for selecting options.
#define TRACE_OBJ
Definition tracer.h:34