From 92e696b4bad52c40c6cdc1c5bf7c0c0ea8a2b283 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sat, 9 Jul 2022 17:01:38 +0200 Subject: Use debug stream in QTest::toString's default fallback if possible For built-in types, this is a compile-time assert - we should not have any types in Qt for which we have neither debug streaming nor a QTest::toString specialization implemented. A build of most of Qt submodules passes with this change, after minor modifications to some tests. We cannot declare QSizeHint::Policy as a metatype after the QMetaType has already been instantiated for it, and the QDebug stream operator for QElaspedTimer needs to be correctly declared within the namespace. Add a self-test function for a custom type, and update reference files of the self-test. Task-number: QTBUG-104867 Pick-to: 6.4 Change-Id: I2936db5933f4589fce45f47cf2f3224ed614d8c9 Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale --- .../widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/auto/widgets/graphicsview') diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index 04d1d0da59..f4b3a5ef99 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -3156,7 +3156,6 @@ void tst_QGraphicsGridLayout::heightForWidthWithSpanning() QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(200, -1)), QSizeF(200, 100)); } -Q_DECLARE_METATYPE(QSizePolicy::Policy) void tst_QGraphicsGridLayout::spanningItem2x2_data() { QTest::addColumn("sizePolicy"); -- cgit v1.2.3