diff options
author | Marco Bubke <marco.bubke@qt.io> | 2022-07-07 17:35:44 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2022-07-11 09:29:37 +0000 |
commit | 67324512e9305eb88cf131b6f6f7eda054e77528 (patch) | |
tree | 9aab3ae3236832d8c896a72793b027dd7d1fcde5 /share/qtcreator/qml/qmlpuppet/qml2puppet/instances | |
parent | 1e6c8f6e6181a8b71d72bdd23685774f89f2368d (diff) |
QmlPuppet: Adapt to C++ 17 [[maybe_unused]]
It has the advantage to to move the attribute to the declaration instead
of using a workaround.
Change-Id: Ia6115ab8fefbe03f247edfea2b7bed73e9149068
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet/instances')
10 files changed, 56 insertions, 106 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp index d8ef223104..41eae06c50 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp @@ -38,10 +38,9 @@ AnimationDriver::~AnimationDriver() } -void AnimationDriver::timerEvent(QTimerEvent *e) +void AnimationDriver::timerEvent([[maybe_unused]] QTimerEvent *e) { Q_ASSERT(e->timerId() == m_timer.timerId()); - Q_UNUSED(e); quint32 old = elapsed(); // Provide same time for all users diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index 41c67f70b6..ad46fc86c3 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -1479,19 +1479,13 @@ QStringList NodeInstanceServer::dummyDataDirectories(const QString &directoryPat } } -void NodeInstanceServer::inputEvent(const InputEventCommand &command) -{ - Q_UNUSED(command) -} +void NodeInstanceServer::inputEvent([[maybe_unused]] const InputEventCommand &command) {} -void NodeInstanceServer::view3DAction(const View3DActionCommand &command) -{ - Q_UNUSED(command) -} +void NodeInstanceServer::view3DAction([[maybe_unused]] const View3DActionCommand &command) {} -void NodeInstanceServer::requestModelNodePreviewImage(const RequestModelNodePreviewImageCommand &command) +void NodeInstanceServer::requestModelNodePreviewImage( + [[maybe_unused]] const RequestModelNodePreviewImageCommand &command) { - Q_UNUSED(command) } void NodeInstanceServer::changeLanguage(const ChangeLanguageCommand &command) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index 9f3a1d6b3b..429aec1ef8 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -741,8 +741,7 @@ QObject *ObjectNodeInstance::createPrimitiveFromSource(const QString &typeName, QObject *ObjectNodeInstance::createComponentWrap(const QString &nodeSource, const QByteArray &importCode, QQmlContext *context) { - QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; - Q_UNUSED(disableComponentComplete) + [[maybe_unused]] QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; QQmlComponent *component = new QQmlComponent(context->engine()); @@ -794,12 +793,11 @@ static inline QString fixComponentPathForIncompatibleQt(const QString &component return result; } -QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlContext *context) +QObject *ObjectNodeInstance::createComponent([[maybe_unused]] const QString &componentPath, + QQmlContext *context) { QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; - Q_UNUSED(disableComponentComplete) - QQmlComponent component(context->engine(), fixComponentPathForIncompatibleQt(componentPath)); QObject *object = nullptr; @@ -831,8 +829,7 @@ QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource, const QByteArray &importCode, QQmlContext *context) { - QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; - Q_UNUSED(disableComponentComplete) + [[maybe_unused]] QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; QQmlComponent component(context->engine()); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.cpp index 1e58cdf55b..a26759357d 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.cpp @@ -69,9 +69,8 @@ PositionerNodeInstance::Pointer PositionerNodeInstance::create(QObject *object) void PositionerNodeInstance::refreshLayoutable() { - bool success = QMetaObject::invokeMethod(object(), "prePositioning"); + [[maybe_unused]] bool success = QMetaObject::invokeMethod(object(), "prePositioning"); Q_ASSERT(success); - Q_UNUSED(success) } PropertyNameList PositionerNodeInstance::ignoredProperties() const diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp index c07cc4bfcf..8bd21d9e9f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp @@ -54,11 +54,9 @@ QmlStateNodeInstance::Pointer return instance; } -void setAllNodesDirtyRecursive(QQuickItem *parentItem) +void setAllNodesDirtyRecursive([[maybe_unused]] QQuickItem *parentItem) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - Q_UNUSED(parentItem) -#else +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if (!parentItem) return; const QList<QQuickItem *> children = parentItem->childItems(); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 4448e2cee1..12fba4d048 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -338,7 +338,8 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport() #endif } -void Qt5InformationNodeInstanceServer::updateRotationBlocks(const QVector<PropertyValueContainer> &valueChanges) +void Qt5InformationNodeInstanceServer::updateRotationBlocks( + [[maybe_unused]] const QVector<PropertyValueContainer> &valueChanges) { #ifdef QUICK3D_MODULE auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); @@ -363,12 +364,11 @@ void Qt5InformationNodeInstanceServer::updateRotationBlocks(const QVector<Proper helper->addRotationBlocks(blockedNodes); helper->removeRotationBlocks(unblockedNodes); } -#else - Q_UNUSED(valueChanges) #endif } -void Qt5InformationNodeInstanceServer::removeRotationBlocks(const QVector<qint32> &instanceIds) +void Qt5InformationNodeInstanceServer::removeRotationBlocks( + [[maybe_unused]] const QVector<qint32> &instanceIds) { #ifdef QUICK3D_MODULE auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); @@ -384,8 +384,6 @@ void Qt5InformationNodeInstanceServer::removeRotationBlocks(const QVector<qint32 } helper->removeRotationBlocks(unblockedNodes); } -#else - Q_UNUSED(instanceIds) #endif } @@ -770,7 +768,7 @@ void Qt5InformationNodeInstanceServer::handleView3DSizeChange() updateView3DRect(view3D); } -void Qt5InformationNodeInstanceServer::handleView3DDestroyed(QObject *obj) +void Qt5InformationNodeInstanceServer::handleView3DDestroyed([[maybe_unused]] QObject *obj) { #ifdef QUICK3D_MODULE auto view = qobject_cast<QQuick3DViewport *>(obj); @@ -778,12 +776,10 @@ void Qt5InformationNodeInstanceServer::handleView3DDestroyed(QObject *obj) removeNode3D(view->scene()); if (view && view == m_active3DView) m_active3DView = nullptr; -#else - Q_UNUSED(obj) #endif } -void Qt5InformationNodeInstanceServer::handleNode3DDestroyed(QObject *obj) +void Qt5InformationNodeInstanceServer::handleNode3DDestroyed([[maybe_unused]] QObject *obj) { #ifdef QUICK3D_MODULE if (qobject_cast<QQuick3DCamera *>(obj)) { @@ -804,8 +800,6 @@ void Qt5InformationNodeInstanceServer::handleNode3DDestroyed(QObject *obj) #endif } removeNode3D(obj); -#else - Q_UNUSED(obj) #endif } @@ -820,7 +814,7 @@ void Qt5InformationNodeInstanceServer::updateView3DRect(QObject *view3D) viewPortProperty.write(viewPortrect); } -void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D(bool timerCall) +void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D([[maybe_unused]] bool timerCall) { #ifdef QUICK3D_MODULE if (!m_editView3DSetupDone) @@ -869,8 +863,6 @@ void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D(bool timerC auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); if (helper) helper->storeToolState(helper->globalStateId(), helper->lastSceneIdKey(), QVariant(sceneId), 0); -#else - Q_UNUSED(timerCall) #endif } @@ -1115,7 +1107,8 @@ void Qt5InformationNodeInstanceServer::doRenderModelNodeImageView() #endif } -void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView(const RequestModelNodePreviewImageCommand &cmd) +void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView( + [[maybe_unused]] const RequestModelNodePreviewImageCommand &cmd) { #ifdef QUICK3D_MODULE if (m_modelNode3DImageViewData.rootItem) { @@ -1217,8 +1210,6 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView(const Reques {PuppetToCreatorCommand::RenderModelNodePreviewImage, QVariant::fromValue(imgContainer)}); } -#else - Q_UNUSED(cmd) #endif } @@ -1644,7 +1635,8 @@ void Qt5InformationNodeInstanceServer::add3DScenes(const QList<ServerNodeInstanc } } -QObject *Qt5InformationNodeInstanceServer::findView3DForInstance(const ServerNodeInstance &instance) const +QObject *Qt5InformationNodeInstanceServer::findView3DForInstance( + [[maybe_unused]] const ServerNodeInstance &instance) const { #ifdef QUICK3D_MODULE if (!instance.isValid()) @@ -1669,13 +1661,12 @@ QObject *Qt5InformationNodeInstanceServer::findView3DForInstance(const ServerNod if (view && sceneRoot == view->importScene()) return view3D; } -#else - Q_UNUSED(instance) #endif return {}; } -QObject *Qt5InformationNodeInstanceServer::findView3DForSceneRoot(QObject *sceneRoot) const +QObject *Qt5InformationNodeInstanceServer::findView3DForSceneRoot( + [[maybe_unused]] QObject *sceneRoot) const { #ifdef QUICK3D_MODULE if (!sceneRoot) @@ -1691,13 +1682,12 @@ QObject *Qt5InformationNodeInstanceServer::findView3DForSceneRoot(QObject *scene return view3D; } } -#else - Q_UNUSED(sceneRoot) #endif return {}; } -QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(const ServerNodeInstance &instance) const +QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot( + [[maybe_unused]] const ServerNodeInstance &instance) const { #ifdef QUICK3D_MODULE // The root of a 3D scene is any QQuick3DNode that doesn't have QQuick3DNode as parent. @@ -1760,13 +1750,11 @@ QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(const ServerNodeInsta } } } -#else - Q_UNUSED(instance) #endif return nullptr; } -QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(QObject *obj) const +QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot([[maybe_unused]] QObject *obj) const { #ifdef QUICK3D_MODULE if (hasInstanceForObject(obj)) @@ -1778,15 +1766,14 @@ QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(QObject *obj) const if (view && view->scene() == obj) return obj; } -#else - Q_UNUSED(obj) #endif // Some other non-instance object, assume it's not part of any scene return nullptr; } -void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeInstance> &instanceList, - const CreateSceneCommand &command) +void Qt5InformationNodeInstanceServer::setup3DEditView( + [[maybe_unused]] const QList<ServerNodeInstance> &instanceList, + [[maybe_unused]] const CreateSceneCommand &command) { #ifdef QUICK3D_MODULE if (!m_editView3DData.rootItem) @@ -1887,9 +1874,6 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns // Queue two renders to make sure icon gizmos update properly render3DEditView(2); -#else - Q_UNUSED(instanceList) - Q_UNUSED(command) #endif } @@ -2423,8 +2407,10 @@ void Qt5InformationNodeInstanceServer::removeProperties(const RemovePropertiesCo render3DEditView(); } -void Qt5InformationNodeInstanceServer::handleInstanceLocked(const ServerNodeInstance &instance, - bool enable, bool checkAncestors) +void Qt5InformationNodeInstanceServer::handleInstanceLocked( + [[maybe_unused]] const ServerNodeInstance &instance, + [[maybe_unused]] bool enable, + [[maybe_unused]] bool checkAncestors) { #ifdef QUICK3D_MODULE if (!ViewConfig::isQuick3DMode()) @@ -2458,15 +2444,13 @@ void Qt5InformationNodeInstanceServer::handleInstanceLocked(const ServerNodeInst } } } -#else - Q_UNUSED(instance) - Q_UNUSED(enable) - Q_UNUSED(checkAncestors) #endif } -void Qt5InformationNodeInstanceServer::handleInstanceHidden(const ServerNodeInstance &instance, - bool enable, bool checkAncestors) +void Qt5InformationNodeInstanceServer::handleInstanceHidden( + [[maybe_unused]] const ServerNodeInstance &instance, + [[maybe_unused]] bool enable, + [[maybe_unused]] bool checkAncestors) { #ifdef QUICK3D_MODULE if (!ViewConfig::isQuick3DMode()) @@ -2566,14 +2550,11 @@ void Qt5InformationNodeInstanceServer::handleInstanceHidden(const ServerNodeInst } } } -#else - Q_UNUSED(instance) - Q_UNUSED(enable) - Q_UNUSED(checkAncestors) #endif } -void Qt5InformationNodeInstanceServer::handlePickTarget(const ServerNodeInstance &instance) +void Qt5InformationNodeInstanceServer::handlePickTarget( + [[maybe_unused]] const ServerNodeInstance &instance) { #if defined(QUICK3D_MODULE) && (QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)) // Picking is dependent on hidden status prior to global picking support (<6.2.1), so it is @@ -2656,8 +2637,6 @@ void Qt5InformationNodeInstanceServer::handlePickTarget(const ServerNodeInstance checkChildren(childNode); } } -#else - Q_UNUSED(instance) #endif } @@ -2675,7 +2654,8 @@ void Qt5InformationNodeInstanceServer::handleDynamicAddObject() } // update 3D view size when it changes in creator side -void Qt5InformationNodeInstanceServer::update3DViewState(const Update3dViewStateCommand &command) +void Qt5InformationNodeInstanceServer::update3DViewState( + [[maybe_unused]] const Update3dViewStateCommand &command) { #ifdef QUICK3D_MODULE if (command.type() == Update3dViewStateCommand::SizeChange) { @@ -2694,8 +2674,6 @@ void Qt5InformationNodeInstanceServer::update3DViewState(const Update3dViewState render3DEditView(2); } } -#else - Q_UNUSED(command) #endif } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp index 3ccd6c60dc..18ba701ecc 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp @@ -208,7 +208,7 @@ bool Qt5NodeInstanceServer::rootIsRenderable3DObject() const || rootNodeInstance().isSubclassOf("QQuick3DMaterial"); } -bool Qt5NodeInstanceServer::initRhi(RenderViewData &viewData) +bool Qt5NodeInstanceServer::initRhi([[maybe_unused]] RenderViewData &viewData) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if (!viewData.renderControl) { @@ -286,13 +286,11 @@ bool Qt5NodeInstanceServer::initRhi(RenderViewData &viewData) viewData.window->setRenderTarget(QQuickRenderTarget::fromRhiRenderTarget(viewData.texTarget)); viewData.bufferDirty = false; -#else - Q_UNUSED(viewData) #endif return true; } -QImage Qt5NodeInstanceServer::grabRenderControl(RenderViewData &viewData) +QImage Qt5NodeInstanceServer::grabRenderControl([[maybe_unused]] RenderViewData &viewData) { NANOTRACE_SCOPE("Update", "GrabRenderControl"); @@ -325,8 +323,6 @@ QImage Qt5NodeInstanceServer::grabRenderControl(RenderViewData &viewData) rd->cb->resourceUpdate(readbackBatch); viewData.renderControl->endFrame(); -#else - Q_UNUSED(viewData) #endif return renderImage; } @@ -395,7 +391,7 @@ static bool isLayerEnabled(QQuickItemPrivate *item) } #endif // QT_VERSION check -QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item) +QImage Qt5NodeInstanceServer::grabItem([[maybe_unused]] QQuickItem *item) { QImage renderImage; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) @@ -522,8 +518,6 @@ QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item) if (!isLayerEnabled(pItem)) pItem->derefFromEffectItem(false); -#else - Q_UNUSED(item) #endif return renderImage; } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp index eec52e9992..6c5cb37584 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp @@ -50,8 +50,9 @@ Quick3DNodeInstance::~Quick3DNodeInstance() { } -void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance, - InstanceContainer::NodeFlags flags) +void Quick3DNodeInstance::initialize( + [[maybe_unused]] const ObjectNodeInstance::Pointer &objectNodeInstance, + [[maybe_unused]] InstanceContainer::NodeFlags flags) { #ifdef QUICK3D_MODULE QObject *obj = object(); @@ -82,9 +83,6 @@ void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNo m_dummyRootViewCreateFunction = "createViewForNode"; Quick3DRenderableNodeInstance::initialize(objectNodeInstance, flags); -#else - Q_UNUSED(objectNodeInstance) - Q_UNUSED(flags) #endif // QUICK3D_MODULE } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3drenderablenodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3drenderablenodeinstance.cpp index cae64ad04c..3e799ed69e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3drenderablenodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3drenderablenodeinstance.cpp @@ -110,7 +110,8 @@ QImage Quick3DRenderableNodeInstance::renderImage() const return {}; } -QImage Quick3DRenderableNodeInstance::renderPreviewImage(const QSize &previewImageSize) const +QImage Quick3DRenderableNodeInstance::renderPreviewImage( + [[maybe_unused]] const QSize &previewImageSize) const { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if (!isRootNodeInstance() || !m_dummyRootView) @@ -140,8 +141,6 @@ QImage Quick3DRenderableNodeInstance::renderPreviewImage(const QSize &previewIma return transparentImage; } } -#else - Q_UNUSED(previewImageSize) #endif return {}; } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp index 5b1f3171ad..60d9060325 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp @@ -172,7 +172,7 @@ void QuickItemNodeInstance::enableUnifiedRenderPath(bool unifiedRenderPath) s_unifiedRenderPath = unifiedRenderPath; } -bool QuickItemNodeInstance::checkIfRefFromEffect(qint32 id) +bool QuickItemNodeInstance::checkIfRefFromEffect([[maybe_unused]] qint32 id) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (s_unifiedRenderPath) @@ -180,7 +180,6 @@ bool QuickItemNodeInstance::checkIfRefFromEffect(qint32 id) return (s_createEffectItem || id == 0); #else - Q_UNUSED(id) return false; #endif } @@ -273,14 +272,12 @@ QStringList QuickItemNodeInstance::allStates() const return list; } -void QuickItemNodeInstance::updateDirtyNode(QQuickItem *item) +void QuickItemNodeInstance::updateDirtyNode([[maybe_unused]] QQuickItem *item) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (s_unifiedRenderPath) return; DesignerSupport::updateDirtyNode(item); -#else - Q_UNUSED(item) #endif } @@ -639,11 +636,9 @@ void QuickItemNodeInstance::updateAllDirtyNodesRecursive(QQuickItem *parentItem) updateDirtyNode(parentItem); } -void QuickItemNodeInstance::setAllNodesDirtyRecursive(QQuickItem *parentItem) const +void QuickItemNodeInstance::setAllNodesDirtyRecursive([[maybe_unused]] QQuickItem *parentItem) const { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - Q_UNUSED(parentItem) -#else +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const QList<QQuickItem *> children = parentItem->childItems(); for (QQuickItem *childItem : children) setAllNodesDirtyRecursive(childItem); @@ -656,10 +651,9 @@ static inline bool isRectangleSane(const QRectF &rect) return rect.isValid() && (rect.width() < 10000) && (rect.height() < 10000); } -static bool isEffectItem(QQuickItem *item) +static bool isEffectItem([[maybe_unused]] QQuickItem *item) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - Q_UNUSED(item) return false; #else if (qobject_cast<QQuickShaderEffectSource *>(item)) |