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. Get children Id from another QML file

Get children Id from another QML file

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 1.7k Views 3 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.
  • S Offline
    S Offline
    shwt.saxena
    wrote on last edited by
    #1

    Hey,

    I am trying to get id of children element by another QML file.

    JKSHJ 1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      The id is not an ordinary object property. You cannot refer to it like this:

      Item {
         id: myItem
      }
      Button {
        onClicked: console.log( myItem.id )  // <- wrong
      }
      
      1 Reply Last reply
      0
      • S shwt.saxena

        Hey,

        I am trying to get id of children element by another QML file.

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @shwt.saxena said:

        I am trying to get id of children element by another QML file.

        What do you want to do with the id?

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • S Offline
          S Offline
          shwt.saxena
          wrote on last edited by
          #4

          I want to create modal window when screen navigate to other screen on click event.

          JKSHJ 1 Reply Last reply
          0
          • S shwt.saxena

            I want to create modal window when screen navigate to other screen on click event.

            JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            @shwt.saxena said:

            I want to create modal window when screen navigate to other screen on click event.

            You don't need access to the id. Use signals and signal handlers: http://doc.qt.io/qt-5/qtqml-syntax-signals.html

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            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