diff --git a/apps/opencs/model/settings/setting.cpp b/apps/opencs/model/settings/setting.cpp index 374462ac2..9e33ab916 100644 --- a/apps/opencs/model/settings/setting.cpp +++ b/apps/opencs/model/settings/setting.cpp @@ -375,6 +375,16 @@ QString CSMSettings::Setting::getLabel() const return property (Property_Label).at (0); } +void CSMSettings::Setting::setToolTip (const QString& toolTip) +{ + setProperty (Property_ToolTip, toolTip); +} + +QString CSMSettings::Setting::getToolTip() const +{ + return property (Property_ToolTip).at (0); +} + void CSMSettings::Setting::setProperty (SettingProperty prop, bool value) { setProperty (prop, QStringList() << QVariant (value).toString()); diff --git a/apps/opencs/model/settings/setting.hpp b/apps/opencs/model/settings/setting.hpp index bc542dbd0..be51a531a 100644 --- a/apps/opencs/model/settings/setting.hpp +++ b/apps/opencs/model/settings/setting.hpp @@ -135,6 +135,9 @@ namespace CSMSettings void setLabel (const QString& label); QString getLabel() const; + void setToolTip (const QString& toolTip); + QString getToolTip() const; + ///returns the specified property value QStringList property (SettingProperty prop) const; diff --git a/apps/opencs/model/settings/support.hpp b/apps/opencs/model/settings/support.hpp index 15ad34191..ab0e5088c 100644 --- a/apps/opencs/model/settings/support.hpp +++ b/apps/opencs/model/settings/support.hpp @@ -37,12 +37,13 @@ namespace CSMSettings Property_TicksBelow = 21, Property_StyleSheet = 22, Property_Label = 23, + Property_ToolTip = 24, //Stringlists should always be the last items - Property_DefaultValues = 24, - Property_DeclaredValues = 25, - Property_DefinedValues = 26, - Property_Proxies = 27 + Property_DefaultValues = 25, + Property_DeclaredValues = 26, + Property_DefinedValues = 27, + Property_Proxies = 28 }; ///Basic setting widget types. diff --git a/apps/opencs/view/settings/view.cpp b/apps/opencs/view/settings/view.cpp index dbe2244a6..39c7f89b2 100644 --- a/apps/opencs/view/settings/view.cpp +++ b/apps/opencs/view/settings/view.cpp @@ -19,6 +19,9 @@ CSVSettings::View::View(CSMSettings::Setting *setting, mSerializable (setting->serializable()), Frame(true, setting->getLabel(), parent) { + if (!setting->getToolTip().isEmpty()) + setToolTip (setting->getToolTip()); + setObjectName (setting->name()); buildView(); buildModel (setting);