I would like to split up the code of my application into multiple classes, each class containing a dockwidget with its underlying functionality.
For that I would like to have access to the original "ui" from my mainclass, since the dockwidgets need to change functionality in the main window. How can I connect this?
I have managed to pass the "ui" to a function, but i cant figure out how to store it inside the new object.
Any other approaches to solve this problem are also welcome.
Code:
#ifndef SUBCLASS_H #define SUBCLASS_H #include <ui_mainclass.h> namespace Ui { class MainClass; } class SubClass { private: Ui::Ui_MainClass *ui; public: DataGeneration(Ui_MainClass *myUi); }
Code:
NewSubclass::NewSubclass( Ui_MainClass *myUi) { qDebug() << myUi->tableWidget->rowCount(); // works ui = myUi // does not work }