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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes