/* SPDX-FileCopyrightText: 2017 Volker Krause SPDX-License-Identifier: MIT */ #ifndef KUSERFEEDBACK_QMLPROVIDEREXTENSION_H #define KUSERFEEDBACK_QMLPROVIDEREXTENSION_H #include "qmlabstractdatasource.h" #include #include #include namespace KUserFeedback { class QmlProviderExtension : public QObject { Q_OBJECT Q_PROPERTY(QQmlListProperty sources READ sources) Q_CLASSINFO("DefaultProperty", "sources") public: explicit QmlProviderExtension(QObject *parent = nullptr); ~QmlProviderExtension() override; QQmlListProperty sources(); private: #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typedef qsizetype sizetype; #else typedef int sizetype; #endif static void sourceAppend(QQmlListProperty *prop, QmlAbstractDataSource *value); static sizetype sourceCount(QQmlListProperty *prop); static QmlAbstractDataSource* sourceAt(QQmlListProperty *prop, sizetype index); static void sourceClear(QQmlListProperty *prop); QVector m_sourceWrappers; }; } #endif // KUSERFEEDBACK_QMLPROVIDEREXTENSION_H