KUserFeedback::SelectionRatioSource

Search for usage in LXR

KUserFeedback::SelectionRatioSource Class Reference

#include <selectionratiosource.h>

Inheritance diagram for KUserFeedback::SelectionRatioSource:

Public Member Functions

 SelectionRatioSource (QItemSelectionModel *selectionModel, const QString &sampleName)
 
QVariant data () override
 
QString description () const override
 
void loadImpl (QSettings *settings) override
 
void resetImpl (QSettings *settings) override
 
void setDescription (const QString &desc)
 
void setRole (int role)
 
void storeImpl (QSettings *settings) override
 
- Public Member Functions inherited from KUserFeedback::AbstractDataSource
QString id () const
 
bool isActive () const
 
void load (QSettings *settings)
 
virtual QString name () const
 
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 entry is selected via a QItemSelectionModel.

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.

Definition at line 29 of file selectionratiosource.h.

Constructor & Destructor Documentation

◆ SelectionRatioSource()

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

Create a new selection ratio data source.

Parameters
selectionModelThe selection to monitor.
sampleNameThis is the name of the database field this data source is associated with.

Definition at line 76 of file selectionratiosource.cpp.

Member Function Documentation

◆ data()

QVariant SelectionRatioSource::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 110 of file selectionratiosource.cpp.

◆ description()

QString SelectionRatioSource::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 98 of file selectionratiosource.cpp.

◆ loadImpl()

void SelectionRatioSource::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 131 of file selectionratiosource.cpp.

◆ resetImpl()

void SelectionRatioSource::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 159 of file selectionratiosource.cpp.

◆ setDescription()

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.
Parameters
descThe description.

Definition at line 104 of file selectionratiosource.cpp.

◆ setRole()

void SelectionRatioSource::setRole ( int role)

Determine which role to consider for the reported value.

By default this is Qt::DisplayRole.

Definition at line 92 of file selectionratiosource.cpp.

◆ storeImpl()

void SelectionRatioSource::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 142 of file selectionratiosource.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 Fri Nov 22 2024 12:03:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.