StatusQ: Add insert overload taking array as input
This commit is contained in:
parent
e68d46da99
commit
8ac6c21782
|
@ -91,6 +91,11 @@ void ListModelWrapper::insert(int index, const QJsonObject& dict) {
|
||||||
runExpression(QString("insert(%1, %2)").arg(index).arg(jsonDict));
|
runExpression(QString("insert(%1, %2)").arg(index).arg(jsonDict));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ListModelWrapper::insert(int index, const QJsonArray& data) {
|
||||||
|
QString jsonData = QJsonDocument(data).toJson();
|
||||||
|
runExpression(QString("insert(%1, %2)").arg(index).arg(jsonData));
|
||||||
|
}
|
||||||
|
|
||||||
void ListModelWrapper::append(const QJsonArray& data) {
|
void ListModelWrapper::append(const QJsonArray& data) {
|
||||||
QString jsonData = QJsonDocument(data).toJson();
|
QString jsonData = QJsonDocument(data).toJson();
|
||||||
runExpression(QString("append(%1)").arg(jsonData));
|
runExpression(QString("append(%1)").arg(jsonData));
|
||||||
|
|
|
@ -25,6 +25,7 @@ public:
|
||||||
QVariant get(int index, const QString& roleName);
|
QVariant get(int index, const QString& roleName);
|
||||||
|
|
||||||
void insert(int index, const QJsonObject& dict);
|
void insert(int index, const QJsonObject& dict);
|
||||||
|
void insert(int index, const QJsonArray& data);
|
||||||
void append(const QJsonArray& data);
|
void append(const QJsonArray& data);
|
||||||
void clear();
|
void clear();
|
||||||
void remove(int index, int count = 1);
|
void remove(int index, int count = 1);
|
||||||
|
|
Loading…
Reference in New Issue