summaryrefslogtreecommitdiff
path: root/share/qtcreator/qml/qmlpuppet/qml2puppet
diff options
context:
space:
mode:
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet')
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp11
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/import3d/import3d.cpp7
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp11
3 files changed, 26 insertions, 3 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp
index 4a67141f24..41d389b446 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp
@@ -192,7 +192,11 @@ void SelectionBoxGeometry::doUpdateGeometry()
m = targetRN->parent->globalTransform;
}
rootRN->localTransform = m;
+#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
rootRN->markDirty(QSSGRenderNode::TransformDirtyFlag::TransformNotDirty);
+#else
+ rootRN->markDirty(QSSGRenderNode::DirtyFlag::TransformDirty);
+#endif
rootRN->calculateGlobalVariables();
} else if (!m_spatialNodeUpdatePending) {
// Necessary spatial nodes do not yet exist. Defer selection box creation one frame.
@@ -236,8 +240,15 @@ void SelectionBoxGeometry::getBounds(
if (node != m_targetNode) {
if (renderNode) {
+#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
if (renderNode->flags.testFlag(QSSGRenderNode::Flag::TransformDirty))
renderNode->calculateLocalTransform();
+#else
+ if (renderNode->isDirty(QSSGRenderNode::DirtyFlag::TransformDirty)) {
+ renderNode->localTransform = QSSGRenderNode::calculateTransformMatrix(
+ node->position(), node->scale(), node->pivot(), node->rotation());
+ }
+#endif
localTransform = renderNode->localTransform;
}
trackNodeChanges(node);
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/import3d/import3d.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/import3d/import3d.cpp
index c1cbca6f5e..a6a0c8085f 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/import3d/import3d.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/import3d/import3d.cpp
@@ -50,7 +50,12 @@ void import3D(const QString &sourceAsset, const QString &outDir, int exitId, con
if (!optDoc.isNull() && optDoc.isObject()) {
QString errorStr;
QJsonObject optObj = optDoc.object();
- if (importer->importFile(sourceAsset, outDir, optObj.toVariantMap(), &errorStr)
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
+ const auto &optionsMap = optObj;
+#else
+ const auto optionsMap = optObj.toVariantMap();
+#endif // QT_VERSION >= 6.4.0
+ if (importer->importFile(sourceAsset, outDir, optionsMap, &errorStr)
!= QSSGAssetImportManager::ImportState::Success) {
qWarning() << __FUNCTION__ << "Failed to import 3D asset"
<< sourceAsset << "with error:" << errorStr;
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
index 76b3475872..c306600252 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
@@ -294,7 +294,14 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport()
#ifdef IMPORT_QUICK3D_ASSETS
QSSGAssetImportManager importManager;
const QHash<QString, QStringList> supportedExtensions = importManager.getSupportedExtensions();
- const QHash<QString, QVariantMap> supportedOptions = importManager.getAllOptions();
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
+#define AS_VARIANT_MAP(IT) IT.value().toVariantMap()
+ using PluginOptionMaps = QSSGAssetImportManager::PluginOptionMaps;
+#else
+#define AS_VARIANT_MAP(IT) IT.value()
+ using PluginOptionMaps = QHash<QString, QVariantMap>;
+#endif // QT_VERSION >= 6.4.0
+ const PluginOptionMaps supportedOptions = importManager.getAllOptions();
QVariantMap supportMap;
@@ -308,7 +315,7 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport()
QVariantMap optMap;
auto itOpt = supportedOptions.constBegin();
while (itOpt != supportedOptions.constEnd()) {
- optMap.insert(itOpt.key(), itOpt.value());
+ optMap.insert(itOpt.key(), AS_VARIANT_MAP(itOpt));
++itOpt;
}