diff options
Diffstat (limited to 'collectionwidget.h')
-rw-r--r-- | collectionwidget.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/collectionwidget.h b/collectionwidget.h new file mode 100644 index 0000000..86135bb --- /dev/null +++ b/collectionwidget.h @@ -0,0 +1,35 @@ +#ifndef COLLECTIONWIDGET_H +#define COLLECTIONWIDGET_H + +#include <QWidget> + +class QTreeView; +class QStandardItemModel; +class QSortFilterProxyModel; + +class CollectionWidget : public QWidget { + Q_OBJECT + public: + enum CustomRoles { TypeRole = Qt::UserRole + 1, IdRole = Qt::UserRole + 2, FullPathRole = Qt::UserRole + 3, GenreRole = Qt::UserRole + 4, ArtistRole = Qt::UserRole + 5, TitleRole = Qt::UserRole + 6, AlbumRole = Qt::UserRole + 7, LengthRole = Qt::UserRole + 8, UrlRole = Qt::UserRole + 9, RemoteRole = Qt::UserRole + 10 }; + enum ItemType { Artist, Album, Song, Genre, WebRadio }; + explicit CollectionWidget(QWidget *parent = nullptr); + QTreeView *view() { return mView; } + QStandardItemModel *model() { return mModel; } + QSortFilterProxyModel *proxy() { return mProxy; } + void setHeaders(const QStringList headers) { mHeaders = headers; } + const QStringList headers() const { return mHeaders; } + + signals: + + public slots: + virtual void populate() { return; } + + private: + QTreeView *mView; + QStandardItemModel *mModel; + QSortFilterProxyModel *mProxy; + QStringList mHeaders; + +}; + +#endif // COLLECTIONWIDGET_H |