/* ============================================================ * 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; };