forked from qt-creator/qt-creator
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:
@@ -163,9 +163,13 @@ QVector3D GeneralHelper::panCamera(QQuick3DCamera *camera, const QMatrix4x4 star
|
||||
return startLookAt + delta;
|
||||
}
|
||||
|
||||
float GeneralHelper::zoomCamera(QQuick3DViewport *viewPort, QQuick3DCamera *camera, float distance,
|
||||
float defaultLookAtDistance, const QVector3D &lookAt,
|
||||
float zoomFactor, bool relative)
|
||||
float GeneralHelper::zoomCamera([[maybe_unused]] QQuick3DViewport *viewPort,
|
||||
QQuick3DCamera *camera,
|
||||
float distance,
|
||||
float defaultLookAtDistance,
|
||||
const QVector3D &lookAt,
|
||||
float zoomFactor,
|
||||
bool relative)
|
||||
{
|
||||
// Emprically determined divisor for nice zoom
|
||||
float multiplier = 1.f + (distance / 40.f);
|
||||
@@ -180,8 +184,6 @@ float GeneralHelper::zoomCamera(QQuick3DViewport *viewPort, QQuick3DCamera *came
|
||||
if (const QQuickWindow *w = viewPort->window())
|
||||
orthoFactor *= w->devicePixelRatio();
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(viewPort)
|
||||
#endif
|
||||
camera->setScale(QVector3D(orthoFactor, orthoFactor, orthoFactor));
|
||||
} else if (qobject_cast<QQuick3DPerspectiveCamera *>(camera)) {
|
||||
|
@@ -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>
|
||||
QStringList parts = id.split(':');
|
||||
if (parts.size() == 2) {
|
||||
|
@@ -41,7 +41,9 @@
|
||||
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;
|
||||
#ifdef IMPORT_QUICK3D_ASSETS
|
||||
@@ -63,11 +65,6 @@ void import3D(const QString &sourceAsset, const QString &outDir, const QString &
|
||||
} else {
|
||||
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
|
||||
if (!errorStr.isEmpty()) {
|
||||
qWarning() << __FUNCTION__ << "Failed to import asset:" << errorStr << outDir;
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
@@ -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());
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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();
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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 {};
|
||||
}
|
||||
|
@@ -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))
|
||||
|
@@ -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))
|
||||
//Refcounting is taking care
|
||||
Q_UNUSED(context)
|
||||
Q_UNUSED(propertyName)
|
||||
#else
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
|
||||
QQmlProperty property(object(), QString::fromUtf8(propertyName), context);
|
||||
QQmlPropertyPrivate::setBinding(property, 0, QQmlPropertyPrivate::BypassInterceptor
|
||||
| QQmlPropertyPrivate::DontRemoveBinding);
|
||||
|
@@ -179,11 +179,10 @@ MetaObject::~MetaObject()
|
||||
|
||||
void MetaObject::createNewDynamicProperty(const QString &name)
|
||||
{
|
||||
int id = m_type->createProperty(name.toUtf8());
|
||||
[[maybe_unused]] int id = m_type->createProperty(name.toUtf8());
|
||||
copyTypeMetaObject();
|
||||
setValue(id, QVariant());
|
||||
Q_ASSERT(id >= 0);
|
||||
Q_UNUSED(id)
|
||||
|
||||
//Updating cache
|
||||
QQmlPropertyCache *oldParent = m_cache->parent();
|
||||
|
@@ -336,9 +336,7 @@ void registerNodeInstanceMetaObject(QObject *object, QQmlEngine *engine)
|
||||
|
||||
QObject *createPrimitive(const QString &typeName, int majorNumber, int minorNumber, QQmlContext *context)
|
||||
{
|
||||
ComponentCompleteDisabler disableComponentComplete;
|
||||
|
||||
Q_UNUSED(disableComponentComplete)
|
||||
[[maybe_unused]] ComponentCompleteDisabler disableComponentComplete;
|
||||
|
||||
QObject *object = 0;
|
||||
QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);
|
||||
@@ -431,8 +429,7 @@ QVariant fixResourcePaths(const QVariant &value)
|
||||
|
||||
QObject *createComponent(const QUrl &componentUrl, QQmlContext *context)
|
||||
{
|
||||
ComponentCompleteDisabler disableComponentComplete;
|
||||
Q_UNUSED(disableComponentComplete)
|
||||
[[maybe_unused]] ComponentCompleteDisabler disableComponentComplete;
|
||||
|
||||
QQmlComponent component(context->engine(), componentUrl);
|
||||
|
||||
|
@@ -562,12 +562,11 @@ bool isSubclassOf(QObject *object, const QByteArray &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)
|
||||
QQuickDesignerSupportProperties::getPropertyCache(object, engine);
|
||||
#else
|
||||
Q_UNUSED(engine);
|
||||
QQuickDesignerSupportProperties::getPropertyCache(object);
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user