added set arg functions

This commit is contained in:
Andrei Yankovich 2019-02-02 16:01:28 +03:00
parent 02d3e66885
commit 3b233c72c0
2 changed files with 25 additions and 0 deletions

View File

@ -71,3 +71,15 @@ QString Params::getStrArg(const QString& key) {
QVariant Params::getArg(const QString& key) {
return params.value(key, "");
}
void Params::setArg(const QString &key, const QVariant &val) {
params.insert(key, val);
}
void Params::setEnable(const QString &key, bool enable) {
if (enable) {
params.insert(key, "");
} else {
params.remove(key);
}
}

View File

@ -45,6 +45,19 @@ public:
*/
static QVariant getArg(const QString& key);
/**
* @brief setArg - set value of key
* @param key
*/
static void setArg(const QString& key, const QVariant& val);
/**
* @brief setArg - set boolean value of key
* @param key
* @param enable - new value of key
*/
static void setEnable(const QString& key, bool enable);
/**
* @brief isEndable - check if enable argument of key
* @param key