Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
I am getting an empty string when I try to send qml text, withMyclass.write("some text") this works
Q_INVOKABLE void write(QString text) { // } Text { id: myText text: fronthell } MouseArea { id: ma Myclass.write(myText.text) }
@JobRecrd said in Qml srting to QString:
Myclass.write(fronthell.text)
should be
MouseArea { id: ma onClicked : { Myclass.write(myText.text) } }
@LeLev Sorry, Sorry, I made a mistake in the post, it says myText.text and it doesn't work for some reason.
@JobRecrd see what you get if you print myText.text
onClicked : { console.log(myText.text) //Myclass.write(myText.text) }
also what is "fronthell" is that a variable ?