From 7596bcb971e27330e089a7067b024e476b2ce15e Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 2 Jan 2021 18:30:38 +0000 Subject: library: added tree model git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9613 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/library/librarymodel.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/plugins/General/library/librarymodel.h') diff --git a/src/plugins/General/library/librarymodel.h b/src/plugins/General/library/librarymodel.h index 492b61e56..a13081bdd 100644 --- a/src/plugins/General/library/librarymodel.h +++ b/src/plugins/General/library/librarymodel.h @@ -25,19 +25,29 @@ #include #include +class QSqlDatabase; +class LibraryTreeItem; + class LibraryModel : public QAbstractItemModel { Q_OBJECT public: LibraryModel(QObject *parent = nullptr); + ~LibraryModel(); + bool canFetchMore(const QModelIndex &parent) const override; + void fetchMore(const QModelIndex &parent) override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QModelIndex parent(const QModelIndex &child) const override; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; void refresh(); private: - QStringList m_artists; + LibraryTreeItem *m_rootItem; + }; #endif // LIBRARYMODEL_H -- cgit v1.2.3-13-gbd6f