KUserFeedback

qmlproviderextension.h
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef KUSERFEEDBACK_QMLPROVIDEREXTENSION_H
8#define KUSERFEEDBACK_QMLPROVIDEREXTENSION_H
9
10#include "qmlabstractdatasource.h"
11
12#include <QObject>
13#include <QQmlListProperty>
14#include <QVector>
15
16namespace KUserFeedback {
17
18class QmlProviderExtension : public QObject
19{
22 Q_CLASSINFO("DefaultProperty", "sources")
23
24public:
25 explicit QmlProviderExtension(QObject *parent = nullptr);
26 ~QmlProviderExtension() override;
27
28 QQmlListProperty<QmlAbstractDataSource> sources();
29
30private:
31#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
32 typedef qsizetype sizetype;
33#else
34 typedef int sizetype;
35#endif
36 static void sourceAppend(QQmlListProperty<QmlAbstractDataSource> *prop, QmlAbstractDataSource *value);
37 static sizetype sourceCount(QQmlListProperty<QmlAbstractDataSource> *prop);
38 static QmlAbstractDataSource* sourceAt(QQmlListProperty<QmlAbstractDataSource> *prop, sizetype index);
39 static void sourceClear(QQmlListProperty<QmlAbstractDataSource> *prop);
40
41 QVector<QmlAbstractDataSource*> m_sourceWrappers;
42};
43
44}
45
46#endif // KUSERFEEDBACK_QMLPROVIDEREXTENSION_H
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.