15 #include <QAbstractItemModel>
50 int rowCount(
const QModelIndex &
parent = QModelIndex())
const override;
53 QModelIndex
index(
int row,
int column,
const QModelIndex &
parent = QModelIndex())
const override;
54 QModelIndex
parent(
const QModelIndex &
index)
const override;
55 QVariant
data(
const QModelIndex &
index,
int role = Qt::DisplayRole)
const override;
56 Qt::ItemFlags
flags(
const QModelIndex &
index)
const override;
57 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
58 bool setData(
const QModelIndex &
index,
const QVariant & value,
int role = Qt::EditRole)
override;
59 bool removeRows(
int row,
int count,
const QModelIndex &
parent = QModelIndex())
override;
60 bool insertRows(
int row,
int count,
const QModelIndex &
parent = QModelIndex())
override;
66 QModelIndex
const &
parent,
70 QString
const & title = QString());
75 QModelIndex
addFolder(
int row,
const QModelIndex &
parent,
const QString & name = QString());
84 void copyItems(
int row,
const QModelIndex &
parent,
const QModelIndexList & toCopy);
99 bool hasDescendant(
const QModelIndex & baseIndex,
const QModelIndex & testIndex)
const;
119 QString
key(
const QModelIndex &
index)
const;
126 Qt::SortOrder
const order = Qt::AscendingOrder);
144 bool save(QString fileName = QString(),
const QModelIndex & rootItem = QModelIndex());
154 bool load(QString fileName = QString(),
const QModelIndex & rootItem = QModelIndex());
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void copyItems(int row, const QModelIndex &parent, const QModelIndexList &toCopy)
Copies item to target position.
bool isBookmark(const QModelIndex &index) const
bool hasDescendant(const QModelIndex &baseIndex, const QModelIndex &testIndex) const
bool isFolder(const QModelIndex &index) const
void sortItems(QModelIndex const &parent=QModelIndex(), Qt::SortOrder const order=Qt::AscendingOrder)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
QString description(const QModelIndex &index) const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QHash< int, QByteArray > roleNames() const override
~BtBookmarksModel() override
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
void setDescription(const QModelIndex &index, const QString &description)
set descritpion for index.
QModelIndex parent(const QModelIndex &index) const override
bool load(QString fileName=QString(), const QModelIndex &rootItem=QModelIndex())
Import bookmarks from file.
BtBookmarksModel(QObject *parent=nullptr)
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
CSwordModuleInfo * module(const QModelIndex &index) const
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
QModelIndex addFolder(int row, const QModelIndex &parent, const QString &name=QString())
add new folder.
bool save(QString fileName=QString(), const QModelIndex &rootItem=QModelIndex())
Save bookmarks or specified branch to file.
BtBookmarksModelPrivate *const d_ptr
QModelIndex addBookmark(int const row, QModelIndex const &parent, CSwordModuleInfo const &module, QString const &key, QString const &description=QString(), QString const &title=QString())
add new item with given parameters
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QString key(const QModelIndex &index) const