Details

    • Technical task
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • QML: Compiler, QML: Tooling
    • None

    Description

      Consider:

      import QtQuick
      import QtQuick.Window
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          property color myColor: "orange"
      
          Text {
              text: root.myColor
          }
      }
      

      qmllint says:

      Warning: /home/ulf/untitled1/main.qml:14:15: Cannot assign binding of type QColor to QString [incompatible-type]
              text: root.myColor
                    ^^^^^^^^^^^^
      

      It should be possible to coerce QColor (or any value type for that matter) to QString. QQuickColorValueType has an invokable toString() method. Such a method should be used for string coercion. If it's not available, the result should be some '[object Object]', ie the same thing the engine does.

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              ulherman Ulf Hermann
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes