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

@@ -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());