diff options
-rw-r--r-- | src/gui/kernel/qguivariant.cpp | 3 | ||||
-rw-r--r-- | tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 2842211e1d..b4e936f818 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -115,7 +115,7 @@ static void clear(QVariant::Private *d) QMetaTypeSwitcher::switcher<void>(destructor, d->type, 0); } -// This class is a hack that customizes access to QPolygon +// This class is a hack that customizes access to QPolygon and QPolygonF template<class Filter> class QGuiVariantIsNull : public QVariantIsNull<Filter> { typedef QVariantIsNull<Filter> Base; @@ -126,6 +126,7 @@ public: template<typename T> bool delegate(const T *p) { return Base::delegate(p); } bool delegate(const QPolygon*) { return v_cast<QPolygon>(Base::m_d)->isEmpty(); } + bool delegate(const QPolygonF*) { return v_cast<QPolygonF>(Base::m_d)->isEmpty(); } bool delegate(const void *p) { return Base::delegate(p); } }; static bool isNull(const QVariant::Private *d) 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; } |