KUserFeedback::SelectionRatioSource
#include <selectionratiosource.h>
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()
|
explicit |
Create a new selection ratio data source.
- Parameters
-
selectionModel The selection to monitor. sampleName This 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()
|
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 110 of file selectionratiosource.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 98 of file selectionratiosource.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 131 of file selectionratiosource.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 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
-
desc The 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()
|
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 142 of file selectionratiosource.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.