aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-06-01 16:13:43 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-17 13:52:44 +0000
commitec5c7063c5443709aca57203dba57b6aeafa597c (patch)
treeeba4a62067c0708a4986fbb15a7a63d48f824b9a
parent07956a4e53c3d0bbab6f061e7b311a8ba0110365 (diff)
tst_QQuickStyle: unbreak ubsan build
UBSan checks the type_info of all objects accessed for possible mismatches. QQuickLabelPrivate was not exported, but used in tst_QQuickStyle, breaking UBSan builds. Change-Id: I9265c830f01417a0a1f38413139965559a509bdd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit ebf47e7ea99d38cdd6a3f35ec54c9e020db694c7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quicktemplates2/qquicklabel_p_p.h2
-rw-r--r--tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquicklabel_p_p.h b/src/quicktemplates2/qquicklabel_p_p.h
index 4d6e274cbf..03ee6acef2 100644
--- a/src/quicktemplates2/qquicklabel_p_p.h
+++ b/src/quicktemplates2/qquicklabel_p_p.h
@@ -27,7 +27,7 @@
QT_BEGIN_NAMESPACE
-class QQuickLabelPrivate : public QQuickTextPrivate, public QQuickItemChangeListener
+class Q_AUTOTEST_EXPORT QQuickLabelPrivate : public QQuickTextPrivate, public QQuickItemChangeListener
#if QT_CONFIG(accessibility)
, public QAccessible::ActivationObserver
#endif
diff --git a/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp b/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp
index 4927cedf57..e7572164b8 100644
--- a/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp
+++ b/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp
@@ -119,7 +119,9 @@ void tst_QQuickStyle::configurationFile()
// Make it small so that there's less possibility for the default/system
// pixel size to match it and give us false positives.
QCOMPARE(label->font().pixelSize(), 3);
+#ifdef QT_BUILD_INTERNAL
QCOMPARE(QQuickLabelPrivate::get(label)->palette()->windowText(), Qt::red);
+#endif
}
void tst_QQuickStyle::commandLineArgument()