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>
This commit is contained in:
Marco Bubke
2022-07-07 17:35:44 +02:00
committed by Tim Jenssen
parent 1e6c8f6e61
commit 67324512e9
17 changed files with 76 additions and 136 deletions

View File

@@ -163,9 +163,13 @@ QVector3D GeneralHelper::panCamera(QQuick3DCamera *camera, const QMatrix4x4 star
return startLookAt + delta; return startLookAt + delta;
} }
float GeneralHelper::zoomCamera(QQuick3DViewport *viewPort, QQuick3DCamera *camera, float distance, float GeneralHelper::zoomCamera([[maybe_unused]] QQuick3DViewport *viewPort,
float defaultLookAtDistance, const QVector3D &lookAt, QQuick3DCamera *camera,
float zoomFactor, bool relative) float distance,
float defaultLookAtDistance,
const QVector3D &lookAt,
float zoomFactor,
bool relative)
{ {
// Emprically determined divisor for nice zoom // Emprically determined divisor for nice zoom
float multiplier = 1.f + (distance / 40.f); float multiplier = 1.f + (distance / 40.f);
@@ -180,8 +184,6 @@ float GeneralHelper::zoomCamera(QQuick3DViewport *viewPort, QQuick3DCamera *came
if (const QQuickWindow *w = viewPort->window()) if (const QQuickWindow *w = viewPort->window())
orthoFactor *= w->devicePixelRatio(); orthoFactor *= w->devicePixelRatio();
} }
#else
Q_UNUSED(viewPort)
#endif #endif
camera->setScale(QVector3D(orthoFactor, orthoFactor, orthoFactor)); camera->setScale(QVector3D(orthoFactor, orthoFactor, orthoFactor));
} else if (qobject_cast<QQuick3DPerspectiveCamera *>(camera)) { } else if (qobject_cast<QQuick3DPerspectiveCamera *>(camera)) {

View File

@@ -33,11 +33,10 @@ IconGizmoImageProvider::IconGizmoImageProvider()
{ {
} }
QImage IconGizmoImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) QImage IconGizmoImageProvider::requestImage(const QString &id,
[[maybe_unused]] QSize *size,
[[maybe_unused]] const QSize &requestedSize)
{ {
Q_UNUSED(size)
Q_UNUSED(requestedSize)
// id format: <file name>:<color name> // id format: <file name>:<color name>
QStringList parts = id.split(':'); QStringList parts = id.split(':');
if (parts.size() == 2) { if (parts.size() == 2) {

View File

@@ -41,7 +41,9 @@
namespace Import3D namespace Import3D
{ {
void import3D(const QString &sourceAsset, const QString &outDir, const QString &options) void import3D([[maybe_unused]] const QString &sourceAsset,
[[maybe_unused]] const QString &outDir,
[[maybe_unused]] const QString &options)
{ {
QString errorStr; QString errorStr;
#ifdef IMPORT_QUICK3D_ASSETS #ifdef IMPORT_QUICK3D_ASSETS
@@ -63,11 +65,6 @@ void import3D(const QString &sourceAsset, const QString &outDir, const QString &
} else { } else {
errorStr = QObject::tr("Failed to parse import options: %1").arg(error.errorString()); errorStr = QObject::tr("Failed to parse import options: %1").arg(error.errorString());
} }
#else
errorStr = QObject::tr("QtQuick3D is not available.");
Q_UNUSED(sourceAsset)
Q_UNUSED(outDir)
Q_UNUSED(options)
#endif #endif
if (!errorStr.isEmpty()) { if (!errorStr.isEmpty()) {
qWarning() << __FUNCTION__ << "Failed to import asset:" << errorStr << outDir; qWarning() << __FUNCTION__ << "Failed to import asset:" << errorStr << outDir;

View File

@@ -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_ASSERT(e->timerId() == m_timer.timerId());
Q_UNUSED(e);
quint32 old = elapsed(); quint32 old = elapsed();
// Provide same time for all users // Provide same time for all users

View File

@@ -1479,19 +1479,13 @@ QStringList NodeInstanceServer::dummyDataDirectories(const QString &directoryPat
} }
} }
void NodeInstanceServer::inputEvent(const InputEventCommand &command) void NodeInstanceServer::inputEvent([[maybe_unused]] const InputEventCommand &command) {}
{
Q_UNUSED(command)
}
void NodeInstanceServer::view3DAction(const View3DActionCommand &command) void NodeInstanceServer::view3DAction([[maybe_unused]] const View3DActionCommand &command) {}
{
Q_UNUSED(command)
}
void NodeInstanceServer::requestModelNodePreviewImage(const RequestModelNodePreviewImageCommand &command) void NodeInstanceServer::requestModelNodePreviewImage(
[[maybe_unused]] const RequestModelNodePreviewImageCommand &command)
{ {
Q_UNUSED(command)
} }
void NodeInstanceServer::changeLanguage(const ChangeLanguageCommand &command) void NodeInstanceServer::changeLanguage(const ChangeLanguageCommand &command)

View File

@@ -741,8 +741,7 @@ QObject *ObjectNodeInstance::createPrimitiveFromSource(const QString &typeName,
QObject *ObjectNodeInstance::createComponentWrap(const QString &nodeSource, const QByteArray &importCode, QQmlContext *context) QObject *ObjectNodeInstance::createComponentWrap(const QString &nodeSource, const QByteArray &importCode, QQmlContext *context)
{ {
QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; [[maybe_unused]] QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent *component = new QQmlComponent(context->engine()); QQmlComponent *component = new QQmlComponent(context->engine());
@@ -794,12 +793,11 @@ static inline QString fixComponentPathForIncompatibleQt(const QString &component
return result; return result;
} }
QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlContext *context) QObject *ObjectNodeInstance::createComponent([[maybe_unused]] const QString &componentPath,
QQmlContext *context)
{ {
QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent component(context->engine(), fixComponentPathForIncompatibleQt(componentPath)); QQmlComponent component(context->engine(), fixComponentPathForIncompatibleQt(componentPath));
QObject *object = nullptr; QObject *object = nullptr;
@@ -831,8 +829,7 @@ QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource,
const QByteArray &importCode, const QByteArray &importCode,
QQmlContext *context) QQmlContext *context)
{ {
QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete; [[maybe_unused]] QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent component(context->engine()); QQmlComponent component(context->engine());

View File

@@ -69,9 +69,8 @@ PositionerNodeInstance::Pointer PositionerNodeInstance::create(QObject *object)
void PositionerNodeInstance::refreshLayoutable() void PositionerNodeInstance::refreshLayoutable()
{ {
bool success = QMetaObject::invokeMethod(object(), "prePositioning"); [[maybe_unused]] bool success = QMetaObject::invokeMethod(object(), "prePositioning");
Q_ASSERT(success); Q_ASSERT(success);
Q_UNUSED(success)
} }
PropertyNameList PositionerNodeInstance::ignoredProperties() const PropertyNameList PositionerNodeInstance::ignoredProperties() const

View File

@@ -54,11 +54,9 @@ QmlStateNodeInstance::Pointer
return instance; return instance;
} }
void setAllNodesDirtyRecursive(QQuickItem *parentItem) void setAllNodesDirtyRecursive([[maybe_unused]] QQuickItem *parentItem)
{ {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
Q_UNUSED(parentItem)
#else
if (!parentItem) if (!parentItem)
return; return;
const QList<QQuickItem *> children = parentItem->childItems(); const QList<QQuickItem *> children = parentItem->childItems();

View File

@@ -338,7 +338,8 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport()
#endif #endif
} }
void Qt5InformationNodeInstanceServer::updateRotationBlocks(const QVector<PropertyValueContainer> &valueChanges) void Qt5InformationNodeInstanceServer::updateRotationBlocks(
[[maybe_unused]] const QVector<PropertyValueContainer> &valueChanges)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper);
@@ -363,12 +364,11 @@ void Qt5InformationNodeInstanceServer::updateRotationBlocks(const QVector<Proper
helper->addRotationBlocks(blockedNodes); helper->addRotationBlocks(blockedNodes);
helper->removeRotationBlocks(unblockedNodes); helper->removeRotationBlocks(unblockedNodes);
} }
#else
Q_UNUSED(valueChanges)
#endif #endif
} }
void Qt5InformationNodeInstanceServer::removeRotationBlocks(const QVector<qint32> &instanceIds) void Qt5InformationNodeInstanceServer::removeRotationBlocks(
[[maybe_unused]] const QVector<qint32> &instanceIds)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper);
@@ -384,8 +384,6 @@ void Qt5InformationNodeInstanceServer::removeRotationBlocks(const QVector<qint32
} }
helper->removeRotationBlocks(unblockedNodes); helper->removeRotationBlocks(unblockedNodes);
} }
#else
Q_UNUSED(instanceIds)
#endif #endif
} }
@@ -770,7 +768,7 @@ void Qt5InformationNodeInstanceServer::handleView3DSizeChange()
updateView3DRect(view3D); updateView3DRect(view3D);
} }
void Qt5InformationNodeInstanceServer::handleView3DDestroyed(QObject *obj) void Qt5InformationNodeInstanceServer::handleView3DDestroyed([[maybe_unused]] QObject *obj)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
auto view = qobject_cast<QQuick3DViewport *>(obj); auto view = qobject_cast<QQuick3DViewport *>(obj);
@@ -778,12 +776,10 @@ void Qt5InformationNodeInstanceServer::handleView3DDestroyed(QObject *obj)
removeNode3D(view->scene()); removeNode3D(view->scene());
if (view && view == m_active3DView) if (view && view == m_active3DView)
m_active3DView = nullptr; m_active3DView = nullptr;
#else
Q_UNUSED(obj)
#endif #endif
} }
void Qt5InformationNodeInstanceServer::handleNode3DDestroyed(QObject *obj) void Qt5InformationNodeInstanceServer::handleNode3DDestroyed([[maybe_unused]] QObject *obj)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (qobject_cast<QQuick3DCamera *>(obj)) { if (qobject_cast<QQuick3DCamera *>(obj)) {
@@ -804,8 +800,6 @@ void Qt5InformationNodeInstanceServer::handleNode3DDestroyed(QObject *obj)
#endif #endif
} }
removeNode3D(obj); removeNode3D(obj);
#else
Q_UNUSED(obj)
#endif #endif
} }
@@ -820,7 +814,7 @@ void Qt5InformationNodeInstanceServer::updateView3DRect(QObject *view3D)
viewPortProperty.write(viewPortrect); viewPortProperty.write(viewPortrect);
} }
void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D(bool timerCall) void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D([[maybe_unused]] bool timerCall)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (!m_editView3DSetupDone) if (!m_editView3DSetupDone)
@@ -869,8 +863,6 @@ void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D(bool timerC
auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper);
if (helper) if (helper)
helper->storeToolState(helper->globalStateId(), helper->lastSceneIdKey(), QVariant(sceneId), 0); helper->storeToolState(helper->globalStateId(), helper->lastSceneIdKey(), QVariant(sceneId), 0);
#else
Q_UNUSED(timerCall)
#endif #endif
} }
@@ -1115,7 +1107,8 @@ void Qt5InformationNodeInstanceServer::doRenderModelNodeImageView()
#endif #endif
} }
void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView(const RequestModelNodePreviewImageCommand &cmd) void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView(
[[maybe_unused]] const RequestModelNodePreviewImageCommand &cmd)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (m_modelNode3DImageViewData.rootItem) { if (m_modelNode3DImageViewData.rootItem) {
@@ -1217,8 +1210,6 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView(const Reques
{PuppetToCreatorCommand::RenderModelNodePreviewImage, {PuppetToCreatorCommand::RenderModelNodePreviewImage,
QVariant::fromValue(imgContainer)}); QVariant::fromValue(imgContainer)});
} }
#else
Q_UNUSED(cmd)
#endif #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 #ifdef QUICK3D_MODULE
if (!instance.isValid()) if (!instance.isValid())
@@ -1669,13 +1661,12 @@ QObject *Qt5InformationNodeInstanceServer::findView3DForInstance(const ServerNod
if (view && sceneRoot == view->importScene()) if (view && sceneRoot == view->importScene())
return view3D; return view3D;
} }
#else
Q_UNUSED(instance)
#endif #endif
return {}; return {};
} }
QObject *Qt5InformationNodeInstanceServer::findView3DForSceneRoot(QObject *sceneRoot) const QObject *Qt5InformationNodeInstanceServer::findView3DForSceneRoot(
[[maybe_unused]] QObject *sceneRoot) const
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (!sceneRoot) if (!sceneRoot)
@@ -1691,13 +1682,12 @@ QObject *Qt5InformationNodeInstanceServer::findView3DForSceneRoot(QObject *scene
return view3D; return view3D;
} }
} }
#else
Q_UNUSED(sceneRoot)
#endif #endif
return {}; return {};
} }
QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(const ServerNodeInstance &instance) const QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(
[[maybe_unused]] const ServerNodeInstance &instance) const
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
// The root of a 3D scene is any QQuick3DNode that doesn't have QQuick3DNode as parent. // 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 #endif
return nullptr; return nullptr;
} }
QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(QObject *obj) const QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot([[maybe_unused]] QObject *obj) const
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (hasInstanceForObject(obj)) if (hasInstanceForObject(obj))
@@ -1778,15 +1766,14 @@ QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(QObject *obj) const
if (view && view->scene() == obj) if (view && view->scene() == obj)
return obj; return obj;
} }
#else
Q_UNUSED(obj)
#endif #endif
// Some other non-instance object, assume it's not part of any scene // Some other non-instance object, assume it's not part of any scene
return nullptr; return nullptr;
} }
void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeInstance> &instanceList, void Qt5InformationNodeInstanceServer::setup3DEditView(
const CreateSceneCommand &command) [[maybe_unused]] const QList<ServerNodeInstance> &instanceList,
[[maybe_unused]] const CreateSceneCommand &command)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (!m_editView3DData.rootItem) if (!m_editView3DData.rootItem)
@@ -1887,9 +1874,6 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns
// Queue two renders to make sure icon gizmos update properly // Queue two renders to make sure icon gizmos update properly
render3DEditView(2); render3DEditView(2);
#else
Q_UNUSED(instanceList)
Q_UNUSED(command)
#endif #endif
} }
@@ -2423,8 +2407,10 @@ void Qt5InformationNodeInstanceServer::removeProperties(const RemovePropertiesCo
render3DEditView(); render3DEditView();
} }
void Qt5InformationNodeInstanceServer::handleInstanceLocked(const ServerNodeInstance &instance, void Qt5InformationNodeInstanceServer::handleInstanceLocked(
bool enable, bool checkAncestors) [[maybe_unused]] const ServerNodeInstance &instance,
[[maybe_unused]] bool enable,
[[maybe_unused]] bool checkAncestors)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (!ViewConfig::isQuick3DMode()) if (!ViewConfig::isQuick3DMode())
@@ -2458,15 +2444,13 @@ void Qt5InformationNodeInstanceServer::handleInstanceLocked(const ServerNodeInst
} }
} }
} }
#else
Q_UNUSED(instance)
Q_UNUSED(enable)
Q_UNUSED(checkAncestors)
#endif #endif
} }
void Qt5InformationNodeInstanceServer::handleInstanceHidden(const ServerNodeInstance &instance, void Qt5InformationNodeInstanceServer::handleInstanceHidden(
bool enable, bool checkAncestors) [[maybe_unused]] const ServerNodeInstance &instance,
[[maybe_unused]] bool enable,
[[maybe_unused]] bool checkAncestors)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
if (!ViewConfig::isQuick3DMode()) if (!ViewConfig::isQuick3DMode())
@@ -2566,14 +2550,11 @@ void Qt5InformationNodeInstanceServer::handleInstanceHidden(const ServerNodeInst
} }
} }
} }
#else
Q_UNUSED(instance)
Q_UNUSED(enable)
Q_UNUSED(checkAncestors)
#endif #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)) #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 // 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); checkChildren(childNode);
} }
} }
#else
Q_UNUSED(instance)
#endif #endif
} }
@@ -2675,7 +2654,8 @@ void Qt5InformationNodeInstanceServer::handleDynamicAddObject()
} }
// update 3D view size when it changes in creator side // 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 #ifdef QUICK3D_MODULE
if (command.type() == Update3dViewStateCommand::SizeChange) { if (command.type() == Update3dViewStateCommand::SizeChange) {
@@ -2694,8 +2674,6 @@ void Qt5InformationNodeInstanceServer::update3DViewState(const Update3dViewState
render3DEditView(2); render3DEditView(2);
} }
} }
#else
Q_UNUSED(command)
#endif #endif
} }

View File

@@ -208,7 +208,7 @@ bool Qt5NodeInstanceServer::rootIsRenderable3DObject() const
|| rootNodeInstance().isSubclassOf("QQuick3DMaterial"); || 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 QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (!viewData.renderControl) { if (!viewData.renderControl) {
@@ -286,13 +286,11 @@ bool Qt5NodeInstanceServer::initRhi(RenderViewData &viewData)
viewData.window->setRenderTarget(QQuickRenderTarget::fromRhiRenderTarget(viewData.texTarget)); viewData.window->setRenderTarget(QQuickRenderTarget::fromRhiRenderTarget(viewData.texTarget));
viewData.bufferDirty = false; viewData.bufferDirty = false;
#else
Q_UNUSED(viewData)
#endif #endif
return true; return true;
} }
QImage Qt5NodeInstanceServer::grabRenderControl(RenderViewData &viewData) QImage Qt5NodeInstanceServer::grabRenderControl([[maybe_unused]] RenderViewData &viewData)
{ {
NANOTRACE_SCOPE("Update", "GrabRenderControl"); NANOTRACE_SCOPE("Update", "GrabRenderControl");
@@ -325,8 +323,6 @@ QImage Qt5NodeInstanceServer::grabRenderControl(RenderViewData &viewData)
rd->cb->resourceUpdate(readbackBatch); rd->cb->resourceUpdate(readbackBatch);
viewData.renderControl->endFrame(); viewData.renderControl->endFrame();
#else
Q_UNUSED(viewData)
#endif #endif
return renderImage; return renderImage;
} }
@@ -395,7 +391,7 @@ static bool isLayerEnabled(QQuickItemPrivate *item)
} }
#endif // QT_VERSION check #endif // QT_VERSION check
QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item) QImage Qt5NodeInstanceServer::grabItem([[maybe_unused]] QQuickItem *item)
{ {
QImage renderImage; QImage renderImage;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@@ -522,8 +518,6 @@ QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item)
if (!isLayerEnabled(pItem)) if (!isLayerEnabled(pItem))
pItem->derefFromEffectItem(false); pItem->derefFromEffectItem(false);
#else
Q_UNUSED(item)
#endif #endif
return renderImage; return renderImage;
} }

View File

@@ -50,8 +50,9 @@ Quick3DNodeInstance::~Quick3DNodeInstance()
{ {
} }
void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance, void Quick3DNodeInstance::initialize(
InstanceContainer::NodeFlags flags) [[maybe_unused]] const ObjectNodeInstance::Pointer &objectNodeInstance,
[[maybe_unused]] InstanceContainer::NodeFlags flags)
{ {
#ifdef QUICK3D_MODULE #ifdef QUICK3D_MODULE
QObject *obj = object(); QObject *obj = object();
@@ -82,9 +83,6 @@ void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNo
m_dummyRootViewCreateFunction = "createViewForNode"; m_dummyRootViewCreateFunction = "createViewForNode";
Quick3DRenderableNodeInstance::initialize(objectNodeInstance, flags); Quick3DRenderableNodeInstance::initialize(objectNodeInstance, flags);
#else
Q_UNUSED(objectNodeInstance)
Q_UNUSED(flags)
#endif // QUICK3D_MODULE #endif // QUICK3D_MODULE
} }

View File

@@ -110,7 +110,8 @@ QImage Quick3DRenderableNodeInstance::renderImage() const
return {}; 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 QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (!isRootNodeInstance() || !m_dummyRootView) if (!isRootNodeInstance() || !m_dummyRootView)
@@ -140,8 +141,6 @@ QImage Quick3DRenderableNodeInstance::renderPreviewImage(const QSize &previewIma
return transparentImage; return transparentImage;
} }
} }
#else
Q_UNUSED(previewImageSize)
#endif #endif
return {}; return {};
} }

View File

@@ -172,7 +172,7 @@ void QuickItemNodeInstance::enableUnifiedRenderPath(bool unifiedRenderPath)
s_unifiedRenderPath = 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 QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (s_unifiedRenderPath) if (s_unifiedRenderPath)
@@ -180,7 +180,6 @@ bool QuickItemNodeInstance::checkIfRefFromEffect(qint32 id)
return (s_createEffectItem || id == 0); return (s_createEffectItem || id == 0);
#else #else
Q_UNUSED(id)
return false; return false;
#endif #endif
} }
@@ -273,14 +272,12 @@ QStringList QuickItemNodeInstance::allStates() const
return list; return list;
} }
void QuickItemNodeInstance::updateDirtyNode(QQuickItem *item) void QuickItemNodeInstance::updateDirtyNode([[maybe_unused]] QQuickItem *item)
{ {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (s_unifiedRenderPath) if (s_unifiedRenderPath)
return; return;
DesignerSupport::updateDirtyNode(item); DesignerSupport::updateDirtyNode(item);
#else
Q_UNUSED(item)
#endif #endif
} }
@@ -639,11 +636,9 @@ void QuickItemNodeInstance::updateAllDirtyNodesRecursive(QQuickItem *parentItem)
updateDirtyNode(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) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
Q_UNUSED(parentItem)
#else
const QList<QQuickItem *> children = parentItem->childItems(); const QList<QQuickItem *> children = parentItem->childItems();
for (QQuickItem *childItem : children) for (QQuickItem *childItem : children)
setAllNodesDirtyRecursive(childItem); setAllNodesDirtyRecursive(childItem);
@@ -656,10 +651,9 @@ static inline bool isRectangleSane(const QRectF &rect)
return rect.isValid() && (rect.width() < 10000) && (rect.height() < 10000); 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) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Q_UNUSED(item)
return false; return false;
#else #else
if (qobject_cast<QQuickShaderEffectSource *>(item)) if (qobject_cast<QQuickShaderEffectSource *>(item))

View File

@@ -275,13 +275,10 @@ void DesignerCustomObjectData::setPropertyBinding(QQmlContext *context, const Pr
} }
} }
void DesignerCustomObjectData::keepBindingFromGettingDeleted(QQmlContext *context, const PropertyName &propertyName) void DesignerCustomObjectData::keepBindingFromGettingDeleted(
[[maybe_unused]] QQmlContext *context, [[maybe_unused]] const PropertyName &propertyName)
{ {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) #if (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
//Refcounting is taking care
Q_UNUSED(context)
Q_UNUSED(propertyName)
#else
QQmlProperty property(object(), QString::fromUtf8(propertyName), context); QQmlProperty property(object(), QString::fromUtf8(propertyName), context);
QQmlPropertyPrivate::setBinding(property, 0, QQmlPropertyPrivate::BypassInterceptor QQmlPropertyPrivate::setBinding(property, 0, QQmlPropertyPrivate::BypassInterceptor
| QQmlPropertyPrivate::DontRemoveBinding); | QQmlPropertyPrivate::DontRemoveBinding);

View File

@@ -179,11 +179,10 @@ MetaObject::~MetaObject()
void MetaObject::createNewDynamicProperty(const QString &name) void MetaObject::createNewDynamicProperty(const QString &name)
{ {
int id = m_type->createProperty(name.toUtf8()); [[maybe_unused]] int id = m_type->createProperty(name.toUtf8());
copyTypeMetaObject(); copyTypeMetaObject();
setValue(id, QVariant()); setValue(id, QVariant());
Q_ASSERT(id >= 0); Q_ASSERT(id >= 0);
Q_UNUSED(id)
//Updating cache //Updating cache
QQmlPropertyCache *oldParent = m_cache->parent(); QQmlPropertyCache *oldParent = m_cache->parent();

View File

@@ -336,9 +336,7 @@ void registerNodeInstanceMetaObject(QObject *object, QQmlEngine *engine)
QObject *createPrimitive(const QString &typeName, int majorNumber, int minorNumber, QQmlContext *context) QObject *createPrimitive(const QString &typeName, int majorNumber, int minorNumber, QQmlContext *context)
{ {
ComponentCompleteDisabler disableComponentComplete; [[maybe_unused]] ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QObject *object = 0; QObject *object = 0;
QQmlType *type = getQmlType(typeName, majorNumber, minorNumber); QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);
@@ -431,8 +429,7 @@ QVariant fixResourcePaths(const QVariant &value)
QObject *createComponent(const QUrl &componentUrl, QQmlContext *context) QObject *createComponent(const QUrl &componentUrl, QQmlContext *context)
{ {
ComponentCompleteDisabler disableComponentComplete; [[maybe_unused]] ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent component(context->engine(), componentUrl); QQmlComponent component(context->engine(), componentUrl);

View File

@@ -562,12 +562,11 @@ bool isSubclassOf(QObject *object, const QByteArray &superTypeName)
return QQuickDesignerSupportMetaInfo::isSubclassOf(object, superTypeName); return QQuickDesignerSupportMetaInfo::isSubclassOf(object, superTypeName);
} }
void getPropertyCache(QObject *object, QQmlEngine *engine) void getPropertyCache(QObject *object, [[maybe_unused]] QQmlEngine *engine)
{ {
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
QQuickDesignerSupportProperties::getPropertyCache(object, engine); QQuickDesignerSupportProperties::getPropertyCache(object, engine);
#else #else
Q_UNUSED(engine);
QQuickDesignerSupportProperties::getPropertyCache(object); QQuickDesignerSupportProperties::getPropertyCache(object);
#endif #endif
} }