mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-26 09:44:38 +00:00
added set arg functions
This commit is contained in:
parent
02d3e66885
commit
3b233c72c0
12
params.cpp
12
params.cpp
@ -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);
|
||||
}
|
||||
}
|
||||
|
13
params.h
13
params.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user