diff options
author | aqua <aqua@iserlohn-fortress.net> | 2023-01-08 13:22:41 +0200 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2023-01-08 13:22:41 +0200 |
commit | 6d25c63f29103f53fc151de0f2dfa91fdb852093 (patch) | |
tree | f5fb9e8d4fbc854377d82e69a8c88d0814149b13 /playlist/playlistmodel.hpp | |
download | nyamp-master.tar.xz |
Diffstat (limited to 'playlist/playlistmodel.hpp')
-rw-r--r-- | playlist/playlistmodel.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/playlist/playlistmodel.hpp b/playlist/playlistmodel.hpp new file mode 100644 index 0000000..e5cedfe --- /dev/null +++ b/playlist/playlistmodel.hpp @@ -0,0 +1,28 @@ +/* ============================================================ + * SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2023 aqua <aqua@iserlohn-fortress.net> + * ============================================================ */ + +#pragma once + +#include <QAbstractItemModel> + +class Playlist; +class PlaylistModel : public QAbstractItemModel { +public: + explicit PlaylistModel(Playlist *parent); + ~PlaylistModel() = default; + + QModelIndex index(int row, int column, const QModelIndex &parent) const; + QModelIndex parent(const QModelIndex &child) const; + int rowCount(const QModelIndex &parent) const; + int columnCount(const QModelIndex &parent) const; + QVariant data(const QModelIndex &index, int role) const; + +private slots: + void beginInsertItems(int start, int end) { beginInsertRows(QModelIndex(), start, end); } + void endInsertItems() { endInsertRows(); } + +private: + Playlist *playlist; +}; |