Cannot assign to non-existent property
-
Hello everybody,
I create a qml file Bar with the code:
Bar.qml :
Item{ property alias titleText : machineModelText.text property alias setPixelSize : machineModelText.font.pixelSize Text { id: machineModelText //font.pixelSize: 20 font.capitalization: Font.AllUppercase color: topMenuBarGI.modelTextColor verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft anchors { left: parent.left top : parent.top bottom : parent.bottom margins: topMenuBarGI.modelHorizontalMargin } } }
and in my main.qml I do :
Bar{ setPixelSize : 10 titleText : "Hello" }
It works for titleText but not for setPixelSize, I have the error message : Cannot assign to non-existent property "setPixelSize", why ?
thanks for your help
-
Alias cannot be reference to grouped property.
-
Hello everybody,
I create a qml file Bar with the code:
Bar.qml :
Item{ property alias titleText : machineModelText.text property alias setPixelSize : machineModelText.font.pixelSize Text { id: machineModelText //font.pixelSize: 20 font.capitalization: Font.AllUppercase color: topMenuBarGI.modelTextColor verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft anchors { left: parent.left top : parent.top bottom : parent.bottom margins: topMenuBarGI.modelHorizontalMargin } } }
and in my main.qml I do :
Bar{ setPixelSize : 10 titleText : "Hello" }
It works for titleText but not for setPixelSize, I have the error message : Cannot assign to non-existent property "setPixelSize", why ?
thanks for your help