Commit 6227b7e7 authored by David Redondo's avatar David Redondo 🏎

Adjust some api docs

Add clarification on how to use Formatter from Qml and
fix documentatio of enum values.
parent 6e8550c8
......@@ -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:
......
......@@ -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
{
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment