Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Element ids vs context property names
Forum Updated to NodeBB v4.3 + New Features

Element ids vs context property names

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.3k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    ludde
    wrote on 15 Mar 2012, 16:03 last edited by
    #1

    Normally, using plain QML, I can create elements as children of other elements, give them ids, and refer to them using those ids.

    But now I want to instead add elements from C++, as context properties, and am a bit confused about how to use ids and context property names. Can I assign ids from C++, or is that not possible? If an element has an id, but is added as a context property, should I reference it in the QML through its id or its context property name?

    What seems to work is to not give it an id, and reference it through the context property name, but is that the best/proper/only way to do it?

    1 Reply Last reply
    0

    1/1

    15 Mar 2012, 16:03

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved