18 #include <QJsonDocument> 65 text =
new QString(
"");
99 QByteArray array (json.toStdString().c_str());
100 QJsonDocument doc = QJsonDocument::fromJson(array);
101 QJsonObject jsonObject = doc.object();
135 QJsonDocument doc(*obj);
136 QByteArray bytes = doc.toJson();
138 return QString(bytes);
143 QJsonObject* obj =
new QJsonObject();
145 obj->insert(
"sampleRate", QJsonValue(
sample_rate));
148 obj->insert(
"wpm", QJsonValue(
wpm));
151 obj->insert(
"mode", QJsonValue(
mode));
153 if(
text !=
nullptr && *
text != QString(
"")){
157 obj->insert(
"loop", QJsonValue(
loop));
163 obj->insert(
"dotKey", QJsonValue(
dot_key));
169 obj->insert(
"dashKey", QJsonValue(
dash_key));
281 bool isObjectUpdated =
false;
286 if(
text !=
nullptr && *
text != QString(
"")){ isObjectUpdated =
true;
break;}
294 return isObjectUpdated;
virtual void fromJsonObject(QJsonObject &json) override
bool m_keyboard_iambic_isSet
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
virtual SWGCWKeyerSettings * fromJson(QString &jsonString) override
void setLoop(qint32 loop)
bool m_dash_key_modifiers_isSet
qint32 dash_key_modifiers
qint32 getDashKeyModifiers()
qint32 getKeyboardIambic()
void setText(QString *text)
qint32 getDotKeyModifiers()
virtual QJsonObject * asJsonObject() override
void setMode(qint32 mode)
void setKeyboardIambic(qint32 keyboard_iambic)
void setDashKey(qint32 dash_key)
virtual ~SWGCWKeyerSettings()
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
void setSampleRate(qint32 sample_rate)
virtual bool isSet() override
void setDashKeyModifiers(qint32 dash_key_modifiers)
virtual QString asJson() override
void setDotKey(qint32 dot_key)
void setDotKeyModifiers(qint32 dot_key_modifiers)
bool m_dot_key_modifiers_isSet