| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2020 Marco Martin <[email protected]> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | // This class exposes KDescendantsProxyModel in a more QML friendly way |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include <KDescendantsProxyModel> |
| 12 | #include <QObject> |
| 13 | #include <QPointer> |
| 14 | |
| 15 | #include <qqmlregistration.h> |
| 16 | |
| 17 | /*! |
| 18 | * \qmltype KDescendantsProxyModel |
| 19 | * \inqmlmodule org.kde.kitemmodels |
| 20 | * \nativetype KDescendantsProxyModel |
| 21 | * \brief Proxy Model for restructuring a Tree into a list. |
| 22 | */ |
| 23 | class KDescendantsProxyModelQml : public KDescendantsProxyModel |
| 24 | { |
| 25 | Q_OBJECT |
| 26 | QML_NAMED_ELEMENT(KDescendantsProxyModel) |
| 27 | |
| 28 | public: |
| 29 | explicit KDescendantsProxyModelQml(QObject *parent = nullptr); |
| 30 | ~KDescendantsProxyModelQml() override; |
| 31 | |
| 32 | /*! |
| 33 | * \qmlproperty var KDescendantsProxyModel::model |
| 34 | * \since 5.62 |
| 35 | */ |
| 36 | |
| 37 | /*! |
| 38 | * \qmlproperty bool KDescendantsProxyModel::displayAncestorData |
| 39 | * \since 5.62 |
| 40 | */ |
| 41 | |
| 42 | /*! |
| 43 | * \qmlmethod KDescendantsProxyModel::expandChildren(int row) |
| 44 | */ |
| 45 | Q_INVOKABLE void expandChildren(int row); |
| 46 | /*! |
| 47 | * \qmlmethod KDescendantsProxyModel::collapseChildren(int row) |
| 48 | */ |
| 49 | Q_INVOKABLE void collapseChildren(int row); |
| 50 | /*! |
| 51 | * \qmlmethod KDescendantsProxyModel::toggleChildren(int row) |
| 52 | */ |
| 53 | Q_INVOKABLE void toggleChildren(int row); |
| 54 | }; |
| 55 | |