Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-4391

DesignStudio built with Qt6 fails to read properties of type var

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • QDS 2.1
    • Qt 6 support
    • None
    • macOS
    • e7f923e9f1031996e14cd5f71fe98d70d5f5ecc2 (qt-creator/qt-creator/4.15)
    • QDS 2D- 2021 Week 18/19

    Description

      Design Studio built with Qt6 throws an InvalidArgumentException when opening a scene that contains keyframes.

      Exception: "InvalidArgumentException"
      Function: "setValue"
      File: "...src/plugins/qmldesigner/designercore/model/variantproperty.cpp"
      Line: 62
      "file: .../qt-creator/src/plugins/qmldesigner/designercore/model/variantproperty.cpp, function: setValue, line: 62"

      The reason is a failed attempt to convert the value argument which is of type var in propertyparser.cpp::read(int variantType, const QString &str)
      ...
      // with variantType == QVariant::QVariant

      value = QVariant(str);
      // value == QVariant(QString, "540")

      value.convert(static_cast<QVariant::Type>(variantType));
      // value == QVariant(QVariant, QVariant(Invalid))

      A quickfix that worked on my side was to add a switch case for QVariant that deals with the issue.
      Not sure if this should be better fixed in QVariant though. (... or if this an intended behaviour change)

      Attachments

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

        Activity

          People

            thohartm Thomas Hartmann
            knud Knud Dollereder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes