From c057e23b02637c1fad270a0cfe2248b50ee418f6 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 9 Oct 2013 13:47:52 +0200 Subject: When creating QVariant(QPolygonF()) this should be a null variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handling of the null QPolygonF case was not correct as it would always be seen as valid. This ensures it is treated in the same way as QPolygon when it is in fact null. [ChangeLog][QtGui][QPolygonF] When a QVariant holds a QPolygonF() then it will be correctly seen as a null QVariant. Change-Id: Icae34f513c3a8e1dd3f50cb64a3d13ae7c636cc4 Reviewed-by: Stephen Kelly Reviewed-by: Jędrzej Nowacki --- tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto') diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 8a68f40f3f..4b2cce63e5 100644 --- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp +++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp @@ -526,6 +526,7 @@ void tst_QGuiVariant::writeToReadFromDataStream_data() QTest::newRow( "pointarray_valid" ) << QVariant::fromValue( QPolygon( QRect( 10, 10, 20, 20 ) ) ) << false; QTest::newRow( "region_invalid" ) << QVariant::fromValue( QRegion() ) << true; QTest::newRow( "region_valid" ) << QVariant::fromValue( QRegion( 10, 10, 20, 20 ) ) << false; + QTest::newRow("polygonf_invalid") << QVariant::fromValue(QPolygonF()) << true; QTest::newRow("polygonf_valid") << QVariant::fromValue(QPolygonF(QRectF(10, 10, 20, 20))) << false; } -- cgit v1.2.3