Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Access and alias problem

    QML and Qt Quick
    2
    2
    82
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      qcoderpro last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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.

        (Z(:^

        1 Reply Last reply Reply Quote 2
        • First post
          Last post