Details
Description
The attached code snippet can be used to reproduce the issue. If one has QVariant with a QPolygonF in it and then it is saved to the settings it works fine. The problem is that when the value is read from QSettings into a QVariant and type() is called on it the type is no longer QVariant::PolygonF but QVariant::QQuaternion.
QPolygonF polygon; {QSettings settings("PolygonSetting", "test"); QVariant variant(polygon); settings.setValue("test", variant); qDebug() << "variant value: " << settings.value("test").type(); } QSettings readSettings("PolygonSetting", "test"); qDebug() << "read: " << readSettings.value("test").type();
Expected result:
The application output to console should be:
variant value: QVariant::QPolygonF
read: QVariant::QPolygonF
Actual result:
The application output is:
variant value: QVariant::QPolygonF
read: QVariant::QQuaternion
It is not a off by one issue even though QPolygonF value is QMetaType::QPolygonF 86 and QQuaternion is
QMetaType::QQuaternion 85, it works for QPolygon and QCursor which were tested too.