Hello,

I'm new in Qt-Quick and QML.

I'm learning how to use it with C++.
So I start with this tutorial and I use Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged) :
https://doc.qt.io/qt-5/qtqml-cppintegration-topic.html

with the only difference that I use pageform.ui.qml files.

so on a pageforme I have a text field:
Qt Code:
  1. TextField {
  2. id: textfield
  3. text: "Text"
  4. placeholderText: qsTr("User name")
  5. anchors.centerIn: parent
  6.  
  7. }
To copy to clipboard, switch view to plain text mode 

and in main.qml:
Qt Code:
  1. Page3Form {
  2. textfield
  3. {
  4. text: backend.userName
  5. onTextChanged: backend.userName = text
  6. }
  7. }
To copy to clipboard, switch view to plain text mode 


if I use it like that onTextChaned doesn't works and I've got an error in the debugger console:
Qt Code:
  1. qrc:/main.qml:51: ReferenceError: text is not defined
To copy to clipboard, switch view to plain text mode 

But if I do this in main.qml :
Qt Code:
  1. Page3Form {
  2. textfield
  3. {
  4. text: backend.userName
  5. onTextChanged: backend.userName = textfield.text
  6. }
  7. }
To copy to clipboard, switch view to plain text mode 

It works but I have this message:
Qt Code:
  1. qrc:/Page3Form.ui.qml:25:5: QML TextField: Binding loop detected for property "text"
To copy to clipboard, switch view to plain text mode 

is someone has a clue?

Regards.