Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Parent child relationship!
Forum Updated to NodeBB v4.3 + New Features

Parent child relationship!

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 581 Views
  • 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
    Lasith
    wrote on last edited by
    #1

    I am new to Qt c++ programming and I got to hear about parent child relationship! I want to use an object declared in the parent in the child! How can I achieve this?

    jsulmJ 1 Reply Last reply
    0
    • L Lasith

      I am new to Qt c++ programming and I got to hear about parent child relationship! I want to use an object declared in the parent in the child! How can I achieve this?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Lasith Not really clear what you want to do.
      Do you mean this: http://doc.qt.io/qt-5.9/objecttrees.html ?

      "I want to use an object declared in the parent in the child! How can I achieve this?"
      Why? A child should not know any implementation details of its parent. Child can emit signals which parent can use to do what ever is needed. This way child does not depend on parents implementation details.
      See https://en.wikipedia.org/wiki/Loose_coupling

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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