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

Shapes: PathMultiline and PathPolyline path(s) properties need to work with more data types

    XMLWordPrintable

Details

    • 811b15bd161d12e5c85e093f9f492a0c4fa278d6 (qt/qtdeclarative/5.14) e81ff5732f7884c5c1d9efb1f63ac7ad0dabbcb5 (qt/qtdeclarative/5.14)

    Description

      QVariantList works for the JS-only use case that PathMultiline and PathPolyline were created for, but it's terrible in case one wants to expose something reasonable from a C++ property for binding purposes. QQuickPathMultiline::setPaths(const QVariantList &paths) uses a double for loop to create QVector<QVector<QPointF>> pathsList from the QVariantList, then calls the other version of QQuickPathMultiline::setPaths(). But in C++ this vector of vectors, or QVector<QPolygonF>, is the best data type to use for a property that will expose a set of polygons for PathMultiline to render; there is no automatic conversion to QVariantList; and creating a QVariantList in C++ is unnatural and tedious, especially if one already had a vector of polygons ready to go. So we need to change these properties to QVariant and detect various data types, including QVariantList and various vector and list types. If we leave it as QVariantList we will be stuck with a bad API; therefore it needs to be done for 5.14. Alternatively it could be QJSValue to take advantage of any automatic type conversion that the engine is already capable of; needs investigation.

      These came from https://codereview.qt-project.org/c/qt/qtdeclarative/+/256856 and https://codereview.qt-project.org/c/qt/qtdeclarative/+/260751

      Attachments

        For Gerrit Dashboard: QTBUG-77929
        # Subject Branch Project Status CR V

        Activity

          People

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes