KUserFeedback::SelectionRatioSource Class

class KUserFeedback::SelectionRatioSource

Records the time ratio a given entry is selected via a QItemSelectionModel. More...

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

Public Functions

SelectionRatioSource(QItemSelectionModel *selectionModel, const QString &sampleName)
void setDescription(const QString &desc)
void setRole(int role)

Detailed Description

An example use-case would be the usage ratio of a applications views/modes selected using a model-based view sidebar (such as used in e.g. Kontact).

The default telemetry mode for this source is Provider::DetailedUsageStatistics.

Member Function Documentation

[explicit] SelectionRatioSource::SelectionRatioSource(QItemSelectionModel *selectionModel, const QString &sampleName)

Create a new selection ratio data source.

selectionModel The selection to monitor.

sampleName This is the name of the database field this data source is associated with.

void SelectionRatioSource::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 SelectionRatioSource::setRole(int role)

Determine which role to consider for the reported value. By default this is Qt::DisplayRole.