From 6d25c63f29103f53fc151de0f2dfa91fdb852093 Mon Sep 17 00:00:00 2001 From: aqua Date: Sun, 8 Jan 2023 13:22:41 +0200 Subject: Initial commit --- playlist/playlistmodel.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 playlist/playlistmodel.hpp (limited to 'playlist/playlistmodel.hpp') 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 + * ============================================================ */ + +#pragma once + +#include + +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; +}; -- cgit v1.2.1