-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlaylistBrowserModel.h
34 lines (28 loc) · 1.01 KB
/
PlaylistBrowserModel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef PLAYLISTBROWSERMODEL_H
#define PLAYLISTBROWSERMODEL_H
#include <QAbstractListModel>
#include <QObject>
#include <DBApi.h>
class PlaylistBrowserModel : public QAbstractListModel, public DBWidget {
Q_OBJECT
public:
enum PlaylistsRoles {
PlaylistNameRole = Qt::UserRole + 1,
PlaylistItemsRole,
PlaylistLengthRole
};
PlaylistBrowserModel(QObject *parent = nullptr, DBApi *Api = nullptr);
~PlaylistBrowserModel();
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
Qt::DropActions supportedDropActions() const;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
QHash<int, QByteArray> roleNames() const;
private slots:
void onPlaylistMoved(int, int);
void onPlaylistCreated();
void onPlaylistRenamed(int);
void onPlaylistRemoved(int);
};
#endif // PLAYLISTBROWSERMODEL_H