Unsolved Parent child relationship!
-
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?
-
@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