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. [solved]QML element scope
Qt 6.11 is out! See what's new in the release blog

[solved]QML element scope

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 4.6k 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.
  • K Offline
    K Offline
    kathy
    wrote on last edited by
    #1

    I have a QML element in main.qml. And the it has children elements and each children elements has it children elements. My question is:

    1. Can grand children use its grand parents id to call its properties or send signal by connection?
    2. Can grand parent use its grand children id to call its properties or send signal by connection?
    3. Can any grand children communicate each other by use its id to call its properties or send signal by connection?

    any example for each case?

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      Yes this is possible. I think the only thing that is restricted to siblings or immediate parent/child relationships are anchors - and this is only for performance reasons.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kathy
        wrote on last edited by
        #3

        Is this true for multiple QML files project?

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          Items in external component files are limited in scope to their own file. If you wish to expose properties of internal items in a component then you need to define alias properties in the top-level item of the component. See this "article":http://developer.qt.nokia.com/wiki/QML_Progress_Spinner for an example.

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0

          • Login

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