Pages
API Documentation
On this page

KUserFeedback::PropertyRatioSource Class

Records the time ratio a given QObject property has a specific value. More...

  • Header: #include <KUserFeedback/PropertyRatioSource>
  • CMake: find_package(KF6 REQUIRED COMPONENTS UserFeedbackCore)
    target_link_libraries(mytarget PRIVATE KF6::UserFeedbackCore)
  • Inherits: KUserFeedback::AbstractDataSource

List of all members, including inherited members

Public Functions

Detailed Description

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.

Member Function Documentation

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

Create a new property ratio data source.

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.

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.

value The property value to map.

str The string the property value value should be mapped to.

QObject *PropertyRatioSource::object() const

Returns the monitored object.

See also setObject()

QString PropertyRatioSource::propertyName() const

Returns the property name.

See also setPropertyName()

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.

desc The description.

void PropertyRatioSource::setName(const QString &name)

Set human readable name.

See also AbstractDataSource::name()

void PropertyRatioSource::setObject(QObject *object)

Sets the monitoried object.

See also object()

void PropertyRatioSource::setPropertyName(const QString &name)

Sets the property name that should be monitored.

See also propertyName()

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.