KUserFeedback::PropertyRatioSource

Search for usage in LXR

KUserFeedback::PropertyRatioSource Class Reference

#include <propertyratiosource.h>

Inheritance diagram for KUserFeedback::PropertyRatioSource:

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
 
QObjectobject () 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()

PropertyRatioSource::PropertyRatioSource ( QObject * obj,
const char * propertyName,
const QString & sampleName )
explicit

Create a new property ratio data source.

Parameters
objthe QObject of which a property should be monitored.
propertyNameThe name of the property to monitor. This property must have a change notification signal. The value must have comparison operators registered.
sampleNameThis 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()

void PropertyRatioSource::addValueMapping ( const QVariant & value,
const QString & str )

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
valueThe property value to map.
strThe string the property value value should be mapped to.

Definition at line 166 of file propertyratiosource.cpp.

◆ data()

QVariant PropertyRatioSource::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:

The innermost QAssociativeIterable must only contain one of the following base types (which has to match the corresponding schema entry element):

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()

QString PropertyRatioSource::description ( ) const
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()

void PropertyRatioSource::loadImpl ( QSettings * settings)
overridevirtual

Invoked by load() in order to load individual settings of this data source.

See also
load() description for further details.
Parameters
settingsA QSettings object opened in a dedicated group for loading persistent data.

Reimplemented from KUserFeedback::AbstractDataSource.

Definition at line 225 of file propertyratiosource.cpp.

◆ name()

QString PropertyRatioSource::name ( ) const
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()

void PropertyRatioSource::resetImpl ( QSettings * settings)
overridevirtual

Invoked by reset() in order to reset individual settings of this data source.

See also
reset() description for further details.
Parameters
settingsA 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
descThe 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()

void PropertyRatioSource::storeImpl ( QSettings * settings)
overridevirtual

Invoked by store() in order to store individual settings of this data source.

See also
store() description for further details.
Parameters
settingsA 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:
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.