7#include "qmlpropertysource.h"
8#include <abstractdatasource.h>
17 QVariant data()
override {
return m_data; }
18 QString name()
const override {
return m_name; }
19 QString description()
const override {
return m_description; }
21 void setSourceId(
const QString &
id) {
setId(
id); }
25 QString m_description;
28QmlPropertySource::QmlPropertySource(
QObject* parent)
29 : QmlAbstractDataSource(new CustomPropertySource(), parent)
33QVariant QmlPropertySource::data()
const
35 return source()->
data();
38QString QmlPropertySource::name()
const
40 return source()->name();
43QString QmlPropertySource::description()
const
45 return source()->description();
48QString QmlPropertySource::sourceId()
const
50 return source()->id();
53void QmlPropertySource::setData(
const QVariant& data)
55 if (customSource()->m_data != data) {
56 customSource()->m_data = data;
61void QmlPropertySource::setName(
const QString &name)
63 if (customSource()->m_name != name) {
64 customSource()->m_name = name;
69void QmlPropertySource::setDescription(
const QString& description)
71 if (customSource()->m_description != description) {
72 customSource()->m_description = description;
73 Q_EMIT descriptionChanged(description);
77void QmlPropertySource::setSourceId(
const QString&
id)
79 if (
id != source()->
id()) {
80 customSource()->setSourceId(
id);
85CustomPropertySource * KUserFeedback::QmlPropertySource::customSource()
87 return dynamic_cast<CustomPropertySource*
>(source());
90#include "moc_qmlpropertysource.cpp"
Base class for data sources for telemetry data.
AbstractDataSource(const QString &id, Provider::TelemetryMode mode=Provider::DetailedUsageStatistics)
Create a new data source named name.
void setId(const QString &id)
Set the ID of this data source.
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...