87 QJsonObject t_jsonObjectCommand;
90 if(p_jsonDocument.isObject() && p_jsonDocument.object().value(QString(
"commands")) != QJsonValue::Undefined)
91 t_jsonObjectCommand = p_jsonDocument.object().value(QString(
"commands")).toObject();
95 QJsonObject::Iterator it;
96 for(it = t_jsonObjectCommand.begin(); it != t_jsonObjectCommand.end(); ++it)
98 if(!m_qMapCommands.contains(it.key()))
99 m_qMapCommands.insert(it.key(),
Command(it.key(), it.value().toObject(),
true,
this));
101 qWarning(
"Warning: CommandMap contains command %s already. Insertion skipped.\n", it.key().toUtf8().constData());
136 QString t_sCommandName = t_rawCommand.
command();
142 if(t_rawCommand.
count() >= m_qMapCommands[t_sCommandName].count())
144 m_qMapCommands[t_sCommandName].isJson() = t_rawCommand.
isJson();
147 for(quint32 i = 0; i < m_qMapCommands[t_sCommandName].count(); ++i)
149 QMetaType t_metaType = m_qMapCommands[t_sCommandName][i].metaType();
151 QVariant t_qVariantParam(t_rawCommand.
pValues()[i]);
153 if(t_qVariantParam.canConvert(t_metaType) && t_qVariantParam.convert(t_metaType))
154 m_qMapCommands[t_sCommandName][i] = t_qVariantParam;
159 m_qMapCommands[t_sCommandName].execute();