problem of hierarchy of a project

  • Hello guys , first of all i'm not pro on Qt and C++ , this is why i have this problem
    i created Projet A with Qt Designer ( many widgets ) and i added many classes to this Project (i gonna name them B,C,D....) , my problem is how can i control the main Widget in A from class B for exemple , i created a QTabWidget in class A , now in Class B i want to ADDTab to the QTabWidget from class A( the problem is he does not recognize the name of widgets in class A ) , another exemple i want to add a QPushButton to my MainWindow from class B when i try to put the parent he does not recognize it , i tried to add includes to all file but don't work
    i hope you understand my problem , thanks guys

  • Lifetime Qt Champion


    From the looks of your description you seem to try to create some sort of frankenmonster.

    You should rather start by clearly designing what each element does. From your description you have widgets that should know of each other that are trying to modify each other. Which is bad.

    Typically, I child widget should not know nor try to use its parent widget. It's the parent that should connect and manipulate the child.

Log in to reply