Commit caea6604 authored by David Redondo's avatar David Redondo 🏎
Browse files

Expose minimum and maximum also in ProcessAttributeModel

parent 1bcb66fb
...@@ -71,6 +71,10 @@ QVariant ProcessAttributeModel::data(const QModelIndex &index, int role) const ...@@ -71,6 +71,10 @@ QVariant ProcessAttributeModel::data(const QModelIndex &index, int role) const
return attribute->description(); return attribute->description();
case Role::Unit: case Role::Unit:
return attribute->unit(); return attribute->unit();
case Role::Minimum:
return attribute->min();
case Role::Maximum:
return attribute->max();
} }
return QVariant(); return QVariant();
} }
...@@ -83,5 +87,7 @@ QHash<int, QByteArray> ProcessAttributeModel::roleNames() const ...@@ -83,5 +87,7 @@ QHash<int, QByteArray> ProcessAttributeModel::roleNames() const
{ static_cast<int>(Role::ShortName), "shortName" }, { static_cast<int>(Role::ShortName), "shortName" },
{ static_cast<int>(Role::Description), "description" }, { static_cast<int>(Role::Description), "description" },
{ static_cast<int>(Role::Unit), "unit" }, { static_cast<int>(Role::Unit), "unit" },
{ static_cast<int>(Role::Minimum), "minimum" },
{ static_cast<int>(Role::Maximum), "maximum" },
}); });
} }
...@@ -42,6 +42,8 @@ public: ...@@ -42,6 +42,8 @@ public:
ShortName = Qt::UserRole + 1, /// A shorter human readable translated name of the attribute ShortName = Qt::UserRole + 1, /// A shorter human readable translated name of the attribute
Description, /// A longer, sentence-based description of the attribute Description, /// A longer, sentence-based description of the attribute
Unit, /// The unit, of type KSysGuard::Unit Unit, /// The unit, of type KSysGuard::Unit
Minimum, /// Smallest value this attribute can be in normal situations. A hint for graphing utilities
Maximum, /// Largest value this attribute can be in normal situations. A hint for graphing utilities
}; };
Q_ENUM(Role); Q_ENUM(Role);
......
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