Cannot assign to property of unknown type "QString".
Unsolved
QML and Qt Quick
-
I dont know why I got error "Cannot assign to property of unknown type "QString"." when I using string property string and assign it to text property in Text, here is the qml file
import QtQuick Item { id: root required property string title required property string data width: 200*D.w height: 30*D.h Rectangle { width: parent.width height: parent.height color: "transparent" Text { id: titleText text: title? title : "Undefined" wrapMode: Text.WordWrap width: parent.width/3 height: parent.height anchors { left: parent.left top: parent.top bottom: parent.bottom } horizontalAlignment: Text.AlignHCenter } Text { id: dataText text: data ? data : "Undefined" wrapMode: Text.WordWrap width: parent.width*2/3 height: parent.height anchors { left: titleText.right top: parent.top bottom: parent.bottom } horizontalAlignment: Text.AlignLeft } } }
-
Which Qt version are you using?
Which line in the QML code does the error message refer to?
I don't think it matters, but you should change the assignment line totext: root.title ? root.title : "Undefined"
-
In addition what @Axel-Spoerl has already said, avoid using title, data as your properties. data is already as property in item. So confusing. Better use some other names.