diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-07-14 11:47:04 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-19 15:28:41 +0000 |
commit | 4d89fe418a9713c14c62953424f389f88d4fe060 (patch) | |
tree | 22ab7ad43604c28fe8e4a73e196c95a8f1abe53a | |
parent | 7f4606f6f9ffa96e705858c5e184a6f7b80281d1 (diff) |
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 <andrei.golubev@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit dff7aaf7d20435f2418e6bb50df2238afff9835f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qml/debugger/qqmldebugserviceinterfaces_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 2 | ||||
-rw-r--r-- | 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<QQmlDebugTranslationService>()) { 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<QQmlDebugTranslationService>()) { elideText = service->foundElidedText(q, layoutText, elideText); |