aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/commands
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2020-09-22 11:30:05 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2020-09-22 13:35:20 +0000
commit31ec38dba5efb731b0769a2d3e4d0232d9ba6e22 (patch)
tree76263b6b3e6260057da494c797ccac21c771eff0 /share/qtcreator/qml/qmlpuppet/commands
parent762addfbd0fe355bb0008d9af72bf317a05462c0 (diff)
QmlDesigner: Add navigator tooltip for 3D Components with Node root
This enables showing preview tooltip for all imported 3D models. Also moved the preview image handling out of the model and into NodeInstanceView, where it fits more naturally. Change-Id: I48135d06aa8d9313525dae618e22692563da78fd Fixes: QDS-2807 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/commands')
-rw-r--r--share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.cpp13
-rw-r--r--share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.h4
2 files changed, 14 insertions, 3 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.cpp
index c29ec216c8..17f3a65a13 100644
--- a/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.cpp
+++ b/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.cpp
@@ -32,9 +32,10 @@ namespace QmlDesigner {
RequestModelNodePreviewImageCommand::RequestModelNodePreviewImageCommand() = default;
-RequestModelNodePreviewImageCommand::RequestModelNodePreviewImageCommand(qint32 id, const QSize &size)
+RequestModelNodePreviewImageCommand::RequestModelNodePreviewImageCommand(qint32 id, const QSize &size, const QString &componentPath)
: m_instanceId(id)
, m_size(size)
+ , m_componentPath(componentPath)
{
}
@@ -48,10 +49,16 @@ QSize QmlDesigner::RequestModelNodePreviewImageCommand::size() const
return m_size;
}
+QString RequestModelNodePreviewImageCommand::componentPath() const
+{
+ return m_componentPath;
+}
+
QDataStream &operator<<(QDataStream &out, const RequestModelNodePreviewImageCommand &command)
{
out << int(command.instanceId());
out << command.size();
+ out << command.componentPath();
return out;
}
@@ -60,6 +67,7 @@ QDataStream &operator>>(QDataStream &in, RequestModelNodePreviewImageCommand &co
{
in >> command.m_instanceId;
in >> command.m_size;
+ in >> command.m_componentPath;
return in;
}
@@ -67,7 +75,8 @@ QDebug operator <<(QDebug debug, const RequestModelNodePreviewImageCommand &comm
{
return debug.nospace() << "RequestModelNodePreviewImageCommand("
<< "instanceId: " << command.instanceId() << ", "
- << "size: " << command.size() << ")";
+ << "size: " << command.size() << ", "
+ << "componentPath: " << command.componentPath() << ")";
}
} // namespace QmlDesigner
diff --git a/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.h b/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.h
index f18055695b..14ebe6156f 100644
--- a/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.h
+++ b/share/qtcreator/qml/qmlpuppet/commands/requestmodelnodepreviewimagecommand.h
@@ -40,14 +40,16 @@ class RequestModelNodePreviewImageCommand
public:
RequestModelNodePreviewImageCommand();
- explicit RequestModelNodePreviewImageCommand(qint32 id, const QSize &size);
+ explicit RequestModelNodePreviewImageCommand(qint32 id, const QSize &size, const QString &componentPath);
qint32 instanceId() const;
QSize size() const;
+ QString componentPath() const;
private:
qint32 m_instanceId;
QSize m_size;
+ QString m_componentPath;
};
QDataStream &operator<<(QDataStream &out, const RequestModelNodePreviewImageCommand &command);