Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
automation_tracklist_proxy_model.h
1// SPDX-FileCopyrightText: © 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_BACKEND_AUTOMATION_TRACKLIST_PROXY_MODEL_H__
5#define __GUI_BACKEND_AUTOMATION_TRACKLIST_PROXY_MODEL_H__
6
7#include <QSortFilterProxyModel>
8#include <QtQmlIntegration>
9
13class AutomationTracklistProxyModel : public QSortFilterProxyModel
14{
15 Q_OBJECT
16 QML_ELEMENT
17 Q_PROPERTY (
18 bool showOnlyVisible READ showOnlyVisible WRITE setShowOnlyVisible NOTIFY
19 showOnlyVisibleChanged)
20 Q_PROPERTY (
21 bool showOnlyCreated READ showOnlyCreated WRITE setShowOnlyCreated NOTIFY
22 showOnlyCreatedChanged)
23
24public:
25 explicit AutomationTracklistProxyModel (QObject * parent = nullptr);
26
27 bool showOnlyVisible () const;
28 void setShowOnlyVisible (bool show);
29 Q_SIGNAL void showOnlyVisibleChanged ();
30
31 bool showOnlyCreated () const;
32 void setShowOnlyCreated (bool show);
33 Q_SIGNAL void showOnlyCreatedChanged ();
34
35protected:
36 bool filterAcceptsRow (int source_row, const QModelIndex &source_parent)
37 const override;
38
39 void setSourceModel (QAbstractItemModel * sourceModel) override;
40
41private:
42 bool show_only_visible_ = true;
43 bool show_only_created_ = true;
44};
45
46#endif