KUserFeedback::PropertyRatioSource
#include <propertyratiosource.h>
Public Member Functions | |
PropertyRatioSource (QObject *obj, const char *propertyName, const QString &sampleName) | |
void | addValueMapping (const QVariant &value, const QString &str) |
QVariant | data () override |
QString | description () const override |
void | loadImpl (QSettings *settings) override |
QString | name () const override |
QObject * | object () const |
QString | propertyName () const |
void | resetImpl (QSettings *settings) override |
void | setDescription (const QString &desc) |
void | setId (const QString &id) |
void | setName (const QString &name) |
void | setObject (QObject *object) |
void | setPropertyName (const QString &name) |
void | storeImpl (QSettings *settings) override |
Public Member Functions inherited from KUserFeedback::AbstractDataSource | |
QString | id () const |
bool | isActive () const |
void | load (QSettings *settings) |
void | reset (QSettings *settings) |
void | setActive (bool active) |
void | setTelemetryMode (Provider::TelemetryMode mode) |
void | store (QSettings *settings) |
Provider::TelemetryMode | telemetryMode () const |
Additional Inherited Members | |
Protected Member Functions inherited from KUserFeedback::AbstractDataSource | |
AbstractDataSource (const QString &id, Provider::TelemetryMode mode=Provider::DetailedUsageStatistics) | |
void | setId (const QString &id) |
Detailed Description
Records the time ratio a given QObject property has a specific value.
An example use-case would be the usage ratio of a applications views/modes selected by a QTabWidget or QRadioButton.
The default telemetry mode for this source is Provider::DetailedUsageStatistics.
Definition at line 24 of file propertyratiosource.h.
Constructor & Destructor Documentation
◆ PropertyRatioSource()
|
explicit |
Create a new property ratio data source.
- Parameters
-
obj the QObject of which a property should be monitored. propertyName The name of the property to monitor. This property must have a change notification signal. The value must have comparison operators registered. sampleName This is the name of the database field this data source is associated with.
Definition at line 124 of file propertyratiosource.cpp.
Member Function Documentation
◆ addValueMapping()
Map property value value
to str
for sending to the server.
This is useful to map internal identifiers to portable and persistable values, such as turning pointers or indexes into meaningful descriptions.
- Parameters
-
value The property value to map. str The string the property value value
should be mapped to.
Definition at line 166 of file propertyratiosource.cpp.
◆ data()
|
overridevirtual |
Returns the data gathered by this source.
Implement this to return the data provided by this source. One of the three following formats are expected:
- scalar entries: QAssociativeIterable
- list entries: QSequentialIterable containing QAssociativeIterable
- map entries: QAssociativeIterable containing QAssociativeIterable
The innermost QAssociativeIterable must only contain one of the following base types (which has to match the corresponding schema entry element):
- QString
- int
- double
- bool
All keys must be strings.
- Returns
- A variant complying with the above requirements.
Implements KUserFeedback::AbstractDataSource.
Definition at line 203 of file propertyratiosource.cpp.
◆ description()
|
overridevirtual |
Returns a human-readable, translated description of what this source provides.
- See also
- id()
- Returns
- A translated, human-readable string.
Implements KUserFeedback::AbstractDataSource.
Definition at line 191 of file propertyratiosource.cpp.
◆ loadImpl()
|
overridevirtual |
Invoked by load()
in order to load individual settings of this data source.
- See also
- load() description for further details.
- Parameters
-
settings A QSettings object opened in a dedicated group for loading persistent data.
Reimplemented from KUserFeedback::AbstractDataSource.
Definition at line 225 of file propertyratiosource.cpp.
◆ name()
|
overridevirtual |
Returns a short name of this data source.
Can be empty if short name is meaningless for this data source.
- Returns
- A translated, human-readable string.
Reimplemented from KUserFeedback::AbstractDataSource.
Definition at line 179 of file propertyratiosource.cpp.
◆ object()
QObject * PropertyRatioSource::object | ( | ) | const |
Returns the monitored object.
Definition at line 135 of file propertyratiosource.cpp.
◆ propertyName()
QString PropertyRatioSource::propertyName | ( | ) | const |
Returns the property name.
Definition at line 150 of file propertyratiosource.cpp.
◆ resetImpl()
|
overridevirtual |
Invoked by reset()
in order to reset individual settings of this data source.
- See also
- reset() description for further details.
- Parameters
-
settings A QSettings object opened in a dedicated group for loading persistent data.
Reimplemented from KUserFeedback::AbstractDataSource.
Definition at line 253 of file propertyratiosource.cpp.
◆ setDescription()
void PropertyRatioSource::setDescription | ( | const QString & | desc | ) |
Set human-readable and translated description of the data provided by this source.
- Note
- This must be set before adding this source, sources without description are discarded.
- Parameters
-
desc The description.
Definition at line 197 of file propertyratiosource.cpp.
◆ setId()
void AbstractDataSource::setId | ( | const QString & | id | ) |
Set the ID of this data source.
The ID should not change at runtime, this is only provided for enabling QML API for generic sources.
- See also
- id()
Definition at line 139 of file abstractdatasource.cpp.
◆ setName()
void PropertyRatioSource::setName | ( | const QString & | name | ) |
Set human readable name.
- See also
- AbstractDataSource::name()
Definition at line 185 of file propertyratiosource.cpp.
◆ setObject()
void PropertyRatioSource::setObject | ( | QObject * | object | ) |
Sets the monitoried object.
Definition at line 141 of file propertyratiosource.cpp.
◆ setPropertyName()
void PropertyRatioSource::setPropertyName | ( | const QString & | name | ) |
Sets the property name that should be monitored.
Definition at line 156 of file propertyratiosource.cpp.
◆ storeImpl()
|
overridevirtual |
Invoked by store()
in order to store individual settings of this data source.
- See also
- store() description for further details.
- Parameters
-
settings A QSettings object opened in a dedicated group for loading persistent data.
Reimplemented from KUserFeedback::AbstractDataSource.
Definition at line 236 of file propertyratiosource.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.