Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
libksysguard
Commits
6227b7e7
Commit
6227b7e7
authored
Nov 17, 2020
by
David Redondo
🏎
Browse files
Adjust some api docs
Add clarification on how to use Formatter from Qml and fix documentatio of enum values.
parent
6e8550c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
formatter/Formatter.h
View file @
6227b7e7
...
...
@@ -42,6 +42,10 @@ enum FormatOption {
};
Q_DECLARE_FLAGS
(
FormatOptions
,
FormatOption
)
/**
* A class for formatting sensor values
* @see FormatterWrapper, for using it from Qml
*/
class
FORMATTER_EXPORT
Formatter
{
public:
...
...
formatter/declarative/FormatterWrapper.h
View file @
6227b7e7
...
...
@@ -33,6 +33,9 @@ namespace KSysGuard {
*
* This effectively wraps Formatter::formatValue, removing the FormatOptions flag
* that I couldn't get to work.
*
* It is accessible as `Formatter` inside the `org.kde.ksysguard.formatter` package
* @see Formatter
*/
class
FormatterWrapper
:
public
QObject
{
...
...
sensors/SensorDataModel.h
View file @
6227b7e7
...
...
@@ -65,18 +65,22 @@ class SENSORS_EXPORT SensorDataModel : public QAbstractTableModel, public QQmlPa
Q_PROPERTY
(
QVariantMap
sensorColors
READ
sensorColors
WRITE
setSensorColors
NOTIFY
sensorColorsChanged
)
public:
/**
* The roles that this model exposes
* @see Sensor
*/
enum
AdditionalRoles
{
SensorId
=
Qt
::
UserRole
+
1
,
//< The backend path to the sensor.
Name
,
//< The name of the sensor.
ShortName
,
//< A shorter name for the sensor. This is equal to name if not set.
Description
,
//< A description for the sensor.
Unit
,
//< The unit of the sensor.
Minimum
,
//< The minimum value this sensor can have.
Maximum
,
//< The maximum value this sensor can have.
Type
,
//< The QVariant::Type of the sensor.
Value
,
//< The value of the sensor.
FormattedValue
,
//< A formatted string of the value of the sensor.
Color
,
//< A color of the sensor, if sensorColors is set
SensorId
=
Qt
::
UserRole
+
1
,
//
/
< The backend path to the sensor.
Name
,
//
/
< The name of the sensor.
ShortName
,
//
/
< A shorter name for the sensor. This is equal to name if not set.
Description
,
//
/
< A description for the sensor.
Unit
,
//
/
< The unit of the sensor.
Minimum
,
//
/
< The minimum value this sensor can have.
Maximum
,
//
/
< The maximum value this sensor can have.
Type
,
//
/
< The QVariant::Type of the sensor.
Value
,
//
/
< The value of the sensor.
FormattedValue
,
//
/
< A formatted string of the value of the sensor.
Color
,
//
/
< A color of the sensor, if sensorColors is set
};
Q_ENUM
(
AdditionalRoles
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment