diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri index 59ac62420c9..d3a81cc3705 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri @@ -13,6 +13,10 @@ versionAtLeast(QT_VERSION, 5.15.0) { QT *= quick3dparticles-private DEFINES *= QUICK3D_PARTICLES_MODULE } + qtHaveModule(quick3dassetutils) { + QT *= quick3dassetutils-private + DEFINES *= QUICK3D_ASSET_UTILS_MODULE + } } HEADERS += $$PWD/qt5nodeinstanceserver.h \ diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index d74bdacf5da..b2a84ff53f3 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -104,6 +104,9 @@ #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include "../editor3d/qt5compat/qquick3darealight_p.h" #endif +#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0) +#include +#endif #endif #ifdef QUICK3D_PARTICLES_MODULE @@ -2317,13 +2320,23 @@ void Qt5InformationNodeInstanceServer::handleInstanceHidden(const ServerNodeInst } else { auto checkRepeater = qobject_cast(checkNode); auto checkLoader = qobject_cast(checkNode); +#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0) + auto checkRunLoader = qobject_cast(checkNode); + if (checkRepeater || checkLoader || checkRunLoader) { +#else if (checkRepeater || checkLoader) { +#endif // Repeaters/loaders may not yet have created their children, so we set // _pickTarget on them and connect the notifier. if (checkNode->property("_pickTarget").isNull()) { if (checkRepeater) { QObject::connect(checkRepeater, &QQuick3DRepeater::objectAdded, this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject); +#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0) + } else if (checkRunLoader) { + QObject::connect(checkRunLoader, &QQuick3DRuntimeLoader::statusChanged, + this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject); +#endif } else { QObject::connect(checkLoader, &QQuick3DLoader::loaded, this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp index 734eeee470e..980da0da791 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp @@ -42,6 +42,9 @@ #include #include #include +#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0) +#include +#endif #endif namespace QmlDesigner { @@ -63,11 +66,21 @@ void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNo QObject *obj = object(); auto repObj = qobject_cast(obj); auto loadObj = qobject_cast(obj); +#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0) + auto runLoadObj = qobject_cast(obj); + if (repObj || loadObj || runLoadObj) { +#else if (repObj || loadObj) { +#endif if (auto infoServer = qobject_cast(nodeInstanceServer())) { if (repObj) { QObject::connect(repObj, &QQuick3DRepeater::objectAdded, infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject); +#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0) + } else if (runLoadObj) { + QObject::connect(runLoadObj, &QQuick3DRuntimeLoader::statusChanged, + infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject); +#endif } else { QObject::connect(loadObj, &QQuick3DLoader::loaded, infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject); diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index 4a642acbd9a..86d9894edaf 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -178,6 +178,15 @@ extend_qtc_executable(qml2puppet DEFINES QUICK3D_PARTICLES_MODULE ) +# Quick3DAssetUtils optionally depends on QuickTimeline, so find also it to make the CI build work +find_package(Qt5 5.15.0 COMPONENTS Quick3DAssetUtils QuickTimeline QUIET) +extend_qtc_executable(qml2puppet + CONDITION TARGET Qt5::Quick3DAssetUtils + FEATURE_INFO "Qt Quick 3D asset utils" + DEPENDS Qt5::Quick3DAssetUtilsPrivate + DEFINES QUICK3D_ASSET_UTILS_MODULE +) + extend_qtc_executable(qml2puppet CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.0.0