Skip to content

Instantly share code, notes, and snippets.

@tru

tru/-

Created August 3, 2016 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tru/bd55935d43abb039dcac81d25b17ebc8 to your computer and use it in GitHub Desktop.
Save tru/bd55935d43abb039dcac81d25b17ebc8 to your computer and use it in GitHub Desktop.
diff --git a/src/settings/SettingsSection.cpp b/src/settings/SettingsSection.cpp
index 7519345..fe0e87f 100644
--- a/src/settings/SettingsSection.cpp
+++ b/src/settings/SettingsSection.cpp
@@ -172,3 +172,11 @@ bool SettingsSection::isHidden() const
bool correctPlatform = ((m_platform & Utils::CurrentPlatform()) == Utils::CurrentPlatform());
return (m_hidden || !correctPlatform);
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+QVariant SettingsSection::defaultValue(const QString& key)
+{
+ if (m_values.contains(key))
+ return m_values.value(key)->defaultValue();
+ return QVariant();
+}
diff --git a/src/settings/SettingsSection.h b/src/settings/SettingsSection.h
index c0ef77c..8bd8b88 100644
--- a/src/settings/SettingsSection.h
+++ b/src/settings/SettingsSection.h
@@ -27,6 +27,7 @@ public:
bool isHidden() const;
QVariant value(const QString& key);
+ QVariant defaultValue(const QString& key);
QString sectionName() const { return m_sectionID; }
const QVariantMap allValues() const;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment