aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/commands
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2020-08-17 14:24:01 +0200
committerMarco Bubke <marco.bubke@qt.io>2020-08-17 14:45:22 +0000
commitfcabab7b5f232c48c13cd36062517cc8f60da761 (patch)
treebffb25a96dbd0ea937938fa697f63ae00bcdacd6 /share/qtcreator/qml/qmlpuppet/commands
parent96f0d2517f4da4fb0e5564ec59adc89153e614bf (diff)
QmlDesigner: Extend captured data
Change-Id: I780815e6f42be4f3aceb1d784a685cc330572832 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/commands')
-rw-r--r--share/qtcreator/qml/qmlpuppet/commands/captureddatacommand.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/commands/captureddatacommand.h b/share/qtcreator/qml/qmlpuppet/commands/captureddatacommand.h
index c7950e278b..c9d626e434 100644
--- a/share/qtcreator/qml/qmlpuppet/commands/captureddatacommand.h
+++ b/share/qtcreator/qml/qmlpuppet/commands/captureddatacommand.h
@@ -29,11 +29,41 @@
#include "imagecontainer.h"
+#include <utils/smallstringio.h>
+
namespace QmlDesigner {
class CapturedDataCommand
{
public:
+ struct Property
+ {
+ Property() = default;
+ Property(QString key, QVariant value)
+ : key(std::move(key))
+ , value(std::move(value))
+ {}
+
+ friend QDataStream &operator<<(QDataStream &out, const Property &property)
+ {
+ out << property.key;
+ out << property.value;
+
+ return out;
+ }
+
+ friend QDataStream &operator>>(QDataStream &in, Property &property)
+ {
+ in >> property.key;
+ in >> property.value;
+
+ return in;
+ }
+
+ QString key;
+ QVariant value;
+ };
+
struct NodeData
{
friend QDataStream &operator<<(QDataStream &out, const NodeData &data)
@@ -41,7 +71,7 @@ public:
out << data.nodeId;
out << data.contentRect;
out << data.sceneTransform;
- out << data.text;
+ out << data.properties;
return out;
}
@@ -51,7 +81,7 @@ public:
in >> data.nodeId;
in >> data.contentRect;
in >> data.sceneTransform;
- in >> data.text;
+ in >> data.properties;
return in;
}
@@ -59,7 +89,7 @@ public:
qint32 nodeId = -1;
QRectF contentRect;
QTransform sceneTransform;
- QString text;
+ std::vector<Property> properties;
};
struct StateData
@@ -81,7 +111,8 @@ public:
}
ImageContainer image;
- QVector<NodeData> nodeData;
+ std::vector<NodeData> nodeData;
+ qint32 nodeId = -1;
};
friend QDataStream &operator<<(QDataStream &out, const CapturedDataCommand &command)