Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Access and alias problem



  • Hi,

    Isn't the code TLineEditV2.qml incorrect? How to access text (property alias text: input.text) from main.qml while it's not in the scope ofFocusScope { but its child Rectangle? Also, isn't property alias input: input redundant?


  • Moderators

    It is correct, yes.

    How to access text (property alias text: input.text) from main.qml while it's not in the scope ofFocusScope { but its child Rectangle?

    Make another alias property in that Rectangle.

    Also, isn't property alias input: input redundant?

    No, it exposes the input element to the outside - components which use TLineEditV2.


Log in to reply