From 4d89fe418a9713c14c62953424f389f88d4fe060 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Wed, 14 Jul 2021 11:47:04 +0200 Subject: QQmlDebugServiceInterfaces: Fix build when qml_debug is disabled Without the forward declaration, we don't know what TranslationBindingInformation is in foundTranslationBinding(const TranslationBindingInformation &). Moreover, we not only need to check for the translation feature, but also for the qml_debug feature before trying to use the QQmlDebugTranslationService. Fixes: QTBUG-95162 Change-Id: I7bb100526a22d73637540729c51fa4cf1b148770 Reviewed-by: Andrei Golubev Reviewed-by: Tim Jenssen Reviewed-by: Qt CI Bot (cherry picked from commit dff7aaf7d20435f2418e6bb50df2238afff9835f) Reviewed-by: Qt Cherry-pick Bot --- src/qml/debugger/qqmldebugserviceinterfaces_p.h | 2 ++ src/qml/qml/qqmlbinding.cpp | 2 +- src/quick/items/qquicktext.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qml/debugger/qqmldebugserviceinterfaces_p.h b/src/qml/debugger/qqmldebugserviceinterfaces_p.h index 02367d1984..5d58e4d2e0 100644 --- a/src/qml/debugger/qqmldebugserviceinterfaces_p.h +++ b/src/qml/debugger/qqmldebugserviceinterfaces_p.h @@ -69,6 +69,8 @@ class QQuickWindow; #if !QT_CONFIG(qml_debug) +class TranslationBindingInformation; + class QV4DebugService { public: diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 3212dc5604..62275c792e 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -448,7 +448,7 @@ QQmlBinding *QQmlBinding::createTranslationBinding( b->setNotifyOnValueChanged(true); b->QQmlJavaScriptExpression::setContext(ctxt); b->setScopeObject(obj); -#if QT_CONFIG(translation) +#if QT_CONFIG(translation) && QT_CONFIG(qml_debug) if (QQmlDebugTranslationService *service = QQmlDebugConnector::service()) { service->foundTranslationBinding({unit, binding, b->scopeObject(), ctxt}); diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 379fef7722..0f17af1975 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -1153,7 +1153,7 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline) elideLayout->setFont(layout.font()); elideLayout->setTextOption(layout.textOption()); -#if QT_CONFIG(translation) +#if QT_CONFIG(translation) && QT_CONFIG(qml_debug) if (QQmlDebugTranslationService *service = QQmlDebugConnector::service()) { elideText = service->foundElidedText(q, layoutText, elideText); -- cgit v1.2.3