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

Variant alias properties cannot be converted

    XMLWordPrintable

Details

    Description

      If you define a property aliasing a variant property, the alias property cannot be converted to anything, which makes it pretty useless. Simple example:

      import QtQuick 2.0
      Rectangle {
          width: 800
          height: 600
          Item {
              id: item
              property variant color: Qt.rgba(1, .5, 0, 1)
          }
          property alias colorAlias: item.color
          color: colorAlias // Doesn't work: "Unable to assign QVariant to QColor"
          //color: item.color // Works as expected
      }
      

      This works in Qt 4, but fails in Qt 5, both with Qt Quick 1 and 2.

      Attachments

        Issue Links

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

          Activity

            People

              aakenned Aaron Kennedy
              kkalland Kim Motoyoshi Kalland (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes