summaryrefslogtreecommitdiff
path: root/playlist/playlistmodel.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'playlist/playlistmodel.hpp')
-rw-r--r--playlist/playlistmodel.hpp28
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;
+};