KSysGuard::SensorFaceController
#include <SensorFaceController.h>
Properties | |
QQuickItem * | appearanceConfigUi |
QAbstractItemModel * | availableFacesModel |
QAbstractItemModel * | availablePresetsModel |
QQuickItem * | compactRepresentation |
QQuickItem * | faceConfigUi |
KConfigPropertyMap * | faceConfiguration |
QString | faceId |
QQuickItem * | fullRepresentation |
QJsonArray | highPrioritySensorIds |
QString | icon |
QJsonArray | lowPrioritySensorIds |
int | maxTotalSensors |
QJsonArray | missingSensors |
QString | name |
QVariantMap | sensorColors |
QVariantMap | sensorLabels |
QQuickItem * | sensorsConfigUi |
bool | showTitle |
bool | supportsLowPrioritySensors |
bool | supportsSensorsColors |
bool | supportsTotalSensors |
QML_ELEMENTQString | title |
QJsonArray | totalSensors |
int | updateRateLimit |
Properties inherited from QObject | |
objectName | |
Public Member Functions | |
SensorFaceController (KConfigGroup &config, QQmlEngine *engine, QQmlEngine *configEngine) | |
QQuickItem * | appearanceConfigUi () |
QAbstractItemModel * | availableFacesModel () |
QAbstractItemModel * | availablePresetsModel () |
QQuickItem * | compactRepresentation () |
KConfigGroup | configGroup () const |
QQuickItem * | faceConfigUi () |
KConfigPropertyMap * | faceConfiguration () const |
QString | faceId () const |
QQuickItem * | fullRepresentation () |
QJsonArray | highPrioritySensorIds () const |
const QString | icon () const |
Q_INVOKABLE void | loadPreset (const QString &preset) |
QJsonArray | lowPrioritySensorIds () const |
int | maxTotalSensors () const |
QJsonArray | missingSensors () const |
QString | name () const |
Q_INVOKABLE void | reloadConfig () |
Q_INVOKABLE void | reloadFaceConfiguration () |
Q_INVOKABLE void | replaceSensors (const QString &from, const QString &to) |
Q_INVOKABLE void | savePreset () |
void | savePreset (const std::filesystem::path &path) |
QVariantMap | sensorColors () const |
QVariantMap | sensorLabels () const |
QJsonArray | sensors () const |
QQuickItem * | sensorsConfigUi () |
void | setFaceId (const QString &face) |
void | setHighPrioritySensorIds (const QJsonArray &ids) |
void | setLowPrioritySensorIds (const QJsonArray &ids) |
void | setSensorColors (const QVariantMap &colors) |
void | setSensorLabels (const QVariantMap &labels) |
void | setShouldSync (bool sync) |
void | setShowTitle (bool show) |
void | setTitle (const QString &title) |
void | setTotalSensors (const QJsonArray &sensor) |
void | setUpdateRateLimit (int limit) |
bool | shouldSync () const |
bool | showTitle () const |
bool | supportsLowPrioritySensors () const |
bool | supportsSensorsColors () const |
bool | supportsTotalSensors () const |
QString | title () const |
QJsonArray | totalSensors () const |
Q_INVOKABLE void | uninstallPreset (const QString &pluginId) |
int | updateRateLimit () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
The SensorFaceController links sensor faces and applications in which these faces are shown.
It abstracts the configuration and properties of faces.
For faces it offers information about which sensors should be displayed and hints set by the application about how the information should be displayed. It can be accessed by faces using the SensorFace::controller
property.
Applications can use this class to instantiate faces from a given config and for querying the capabilities of faces.
- Since
- 5.19
Definition at line 43 of file SensorFaceController.h.
Property Documentation
◆ appearanceConfigUi
|
read |
A user interface for configuring the general appearance of a face like the title and the used face.
Emits configurationChanged
if a config value changed. To apply the changes call saveConfig
on it.
Definition at line 142 of file SensorFaceController.h.
◆ availableFacesModel
|
read |
A list of all available faces.
The name is available as the display role and the id as pluginId
Definition at line 153 of file SensorFaceController.h.
◆ availablePresetsModel
|
read |
A list of available face presets.
The name is available as the display role, the id as pluginId
. The properties of the preset can be accessed via the config
role.
Definition at line 158 of file SensorFaceController.h.
◆ compactRepresentation
|
read |
The compact representation of the current face.
Typically only includes the main visualization of the data without legend, title, etc.
Definition at line 128 of file SensorFaceController.h.
◆ faceConfigUi
|
read |
A user interface that is suited for configuring the face specific options.
Emits configurationChanged
if a config value changed. To apply the changes call saveConfig
on it.
- See also
- faceConfiguration
Definition at line 135 of file SensorFaceController.h.
◆ faceConfiguration
|
read |
A map of config options and values that are specific to the current face as defined by the main.xml
of the face.
- See also
- faceConfigUi
Definition at line 117 of file SensorFaceController.h.
◆ faceId
|
readwrite |
The id of the current face.
For example org.kde.ksysguard.textonly
Definition at line 60 of file SensorFaceController.h.
◆ fullRepresentation
|
read |
The full representation of the current face.
Typically includes additional elements like a legend or title
Definition at line 123 of file SensorFaceController.h.
◆ highPrioritySensorIds
|
readwrite |
Sensors that should always be shown in the face.
This is the main list of sensors that are of the most interest.
Definition at line 70 of file SensorFaceController.h.
◆ icon
|
read |
The icon of the current face.
Definition at line 95 of file SensorFaceController.h.
◆ lowPrioritySensorIds
|
readwrite |
Secondary list of sensors.
These sensors do not necessarily appear in main part of the face. For example in most faces they are just added to the legend.
Definition at line 86 of file SensorFaceController.h.
◆ maxTotalSensors
|
read |
The amount of total sensors the current face supports.
Definition at line 111 of file SensorFaceController.h.
◆ missingSensors
|
read |
Contains the paths of missing sensors, if there are any.
Definition at line 166 of file SensorFaceController.h.
◆ name
|
read |
The name of the current face.
Definition at line 91 of file SensorFaceController.h.
◆ sensorColors
|
readwrite |
Maps sensorIds to colors that can be used when a color for something relating to a specific sensor is needed.
Definition at line 75 of file SensorFaceController.h.
◆ sensorLabels
|
readwrite |
Maps sensorIds to user configurable labels than should be displayed instead of the name of the sensor.
Definition at line 80 of file SensorFaceController.h.
◆ sensorsConfigUi
|
read |
A user interface for configuring which sensors are displayed in a face Emits configurationChanged
if a config value changed.
To apply the changes call saveConfig
on it.
Definition at line 148 of file SensorFaceController.h.
◆ showTitle
|
readwrite |
Whether the title should be displayed or if it should be hidden instead.
- See also
- title
Definition at line 56 of file SensorFaceController.h.
◆ supportsLowPrioritySensors
|
read |
Whether the current face can display low priority sensors.
Definition at line 107 of file SensorFaceController.h.
◆ supportsSensorsColors
|
read |
Whether the current face supports sensor colors.
Definition at line 99 of file SensorFaceController.h.
◆ supportsTotalSensors
|
read |
Whether the current face can display total sensors.
Definition at line 103 of file SensorFaceController.h.
◆ title
|
readwrite |
◆ totalSensors
|
readwrite |
Sensors that are typically used to display a total in some way or form.
For example in the pie char face they are not drawn as part of the chart but appear in the centre of it.
Definition at line 65 of file SensorFaceController.h.
◆ updateRateLimit
|
readwrite |
The minimum time that needs to elapse, in milliseconds, between updates of the face.
Definition at line 162 of file SensorFaceController.h.
Constructor & Destructor Documentation
◆ SensorFaceController()
SensorFaceController::SensorFaceController | ( | KConfigGroup & | config, |
QQmlEngine * | engine, | ||
QQmlEngine * | configEngine ) |
Creates a new SensorFaceController.
This is only useful for applications that want display SensorFaces.
SensorFaces can access the controller that created them using their SensorFace::controller
property.
- Parameters
-
config The controller uses this config group to read and save the face configuration engine This engine will be used for creating the Qml components
Definition at line 372 of file SensorFaceController.cpp.
◆ ~SensorFaceController()
|
override |
Definition at line 414 of file SensorFaceController.cpp.
Member Function Documentation
◆ configGroup()
KConfigGroup KSysGuard::SensorFaceController::configGroup | ( | ) | const |
Retrieve the KConfigGroup this controller is using to store configuration.
This is primarily intended to allow adding child groups to the face configuration.
Definition at line 438 of file SensorFaceController.cpp.
◆ faceConfiguration()
KConfigPropertyMap * SensorFaceController::faceConfiguration | ( | ) | const |
Definition at line 755 of file SensorFaceController.cpp.
◆ faceId()
QString SensorFaceController::faceId | ( | ) | const |
Definition at line 750 of file SensorFaceController.cpp.
◆ highPrioritySensorIds()
QJsonArray SensorFaceController::highPrioritySensorIds | ( | ) | const |
Definition at line 511 of file SensorFaceController.cpp.
◆ icon()
const QString SensorFaceController::icon | ( | ) | const |
Definition at line 655 of file SensorFaceController.cpp.
◆ loadPreset()
void SensorFaceController::loadPreset | ( | const QString & | preset | ) |
Loads a specific preset.
- See also
- availablePresetsModel
Definition at line 885 of file SensorFaceController.cpp.
◆ lowPrioritySensorIds()
QJsonArray SensorFaceController::lowPrioritySensorIds | ( | ) | const |
Definition at line 604 of file SensorFaceController.cpp.
◆ maxTotalSensors()
int SensorFaceController::maxTotalSensors | ( | ) | const |
Definition at line 687 of file SensorFaceController.cpp.
◆ missingSensors()
QJsonArray KSysGuard::SensorFaceController::missingSensors | ( | ) | const |
Definition at line 539 of file SensorFaceController.cpp.
◆ name()
QString SensorFaceController::name | ( | ) | const |
Definition at line 650 of file SensorFaceController.cpp.
◆ reloadConfig()
void SensorFaceController::reloadConfig | ( | ) |
Reload the configuration.
Definition at line 854 of file SensorFaceController.cpp.
◆ reloadFaceConfiguration()
void SensorFaceController::reloadFaceConfiguration | ( | ) |
Reload only the face configuration.
This does not touch sensors, colors or anything else, only the config loaded from the face package is reloaded.
Definition at line 1067 of file SensorFaceController.cpp.
◆ replaceSensors()
Replace one sensor with another.
This replaces a configured sensor with a new one. This replacement happens inside the configuration, bypassing thing like the sensor properties which are populated with resolved sensor ids rather than the configured entries.
You should call reloadConfig once you have made all replacements.
Definition at line 1096 of file SensorFaceController.cpp.
◆ savePreset() [1/2]
void SensorFaceController::savePreset | ( | ) |
Save the current configuration as a preset.
Definition at line 942 of file SensorFaceController.cpp.
◆ savePreset() [2/2]
void KSysGuard::SensorFaceController::savePreset | ( | const std::filesystem::path & | path | ) |
Definition at line 966 of file SensorFaceController.cpp.
◆ sensorColors()
QVariantMap SensorFaceController::sensorColors | ( | ) | const |
Definition at line 544 of file SensorFaceController.cpp.
◆ sensorLabels()
QVariantMap SensorFaceController::sensorLabels | ( | ) | const |
Definition at line 575 of file SensorFaceController.cpp.
◆ setFaceId()
void SensorFaceController::setFaceId | ( | const QString & | face | ) |
Definition at line 696 of file SensorFaceController.cpp.
◆ setHighPrioritySensorIds()
void SensorFaceController::setHighPrioritySensorIds | ( | const QJsonArray & | ids | ) |
Definition at line 516 of file SensorFaceController.cpp.
◆ setLowPrioritySensorIds()
void SensorFaceController::setLowPrioritySensorIds | ( | const QJsonArray & | ids | ) |
Definition at line 609 of file SensorFaceController.cpp.
◆ setSensorColors()
void SensorFaceController::setSensorColors | ( | const QVariantMap & | colors | ) |
Definition at line 557 of file SensorFaceController.cpp.
◆ setSensorLabels()
void SensorFaceController::setSensorLabels | ( | const QVariantMap & | labels | ) |
Definition at line 584 of file SensorFaceController.cpp.
◆ setShouldSync()
void SensorFaceController::setShouldSync | ( | bool | sync | ) |
Specifies if the controller should automatically sync configuration changes.
- Parameters
-
sync If true
applied config changes are written to the KConfigGroup that was specified in the constructor. Iffalse
config changes are applied after callingsaveConfig
on a configuration ui but not written to the KConfigGroup.
Definition at line 1059 of file SensorFaceController.cpp.
◆ setShowTitle()
void SensorFaceController::setShowTitle | ( | bool | show | ) |
Definition at line 471 of file SensorFaceController.cpp.
◆ setTitle()
void SensorFaceController::setTitle | ( | const QString & | title | ) |
Definition at line 454 of file SensorFaceController.cpp.
◆ setTotalSensors()
void SensorFaceController::setTotalSensors | ( | const QJsonArray & | sensor | ) |
Definition at line 488 of file SensorFaceController.cpp.
◆ setUpdateRateLimit()
void SensorFaceController::setUpdateRateLimit | ( | int | limit | ) |
Definition at line 637 of file SensorFaceController.cpp.
◆ shouldSync()
bool SensorFaceController::shouldSync | ( | ) | const |
Whether the controller should sync configuration changes.
- See also
- setShouldSync
Definition at line 1054 of file SensorFaceController.cpp.
◆ showTitle()
bool SensorFaceController::showTitle | ( | ) | const |
Definition at line 466 of file SensorFaceController.cpp.
◆ supportsLowPrioritySensors()
bool SensorFaceController::supportsLowPrioritySensors | ( | ) | const |
Definition at line 678 of file SensorFaceController.cpp.
◆ supportsSensorsColors()
bool SensorFaceController::supportsSensorsColors | ( | ) | const |
Definition at line 660 of file SensorFaceController.cpp.
◆ supportsTotalSensors()
bool SensorFaceController::supportsTotalSensors | ( | ) | const |
Definition at line 669 of file SensorFaceController.cpp.
◆ title()
QString SensorFaceController::title | ( | ) | const |
Definition at line 443 of file SensorFaceController.cpp.
◆ totalSensors()
QJsonArray SensorFaceController::totalSensors | ( | ) | const |
Definition at line 483 of file SensorFaceController.cpp.
◆ uninstallPreset()
void SensorFaceController::uninstallPreset | ( | const QString & | pluginId | ) |
Uninstall a specific preset.
Definition at line 1037 of file SensorFaceController.cpp.
◆ updateRateLimit()
int SensorFaceController::updateRateLimit | ( | ) | const |
Definition at line 632 of file SensorFaceController.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.