Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33981

If one reads a QPolygonF from the settings as a QVariant, it returns QQuaternion as the variant type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 5.1.1
    • Core: I/O
    • None
    • Windows 7, Ubuntu 12.04
    • 5c301f4121b4395b968ef3d6404986326ce70048

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            andysh Andy Shaw
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes