Add ready widget into widget
-
Hello I am working on a project. in this project there will be menus on the left side and when clicked, the content of that menu will open on the right side. but I have no idea how it should be done. I am leaving an example


when device is selected there is something else on the right hand side and when text editor is selected there is something else on the right hand side. how does this happen? what is added there?
Is it Qt designer form class (.cpp && .h && .ui)? -
Hello I am working on a project. in this project there will be menus on the left side and when clicked, the content of that menu will open on the right side. but I have no idea how it should be done. I am leaving an example


when device is selected there is something else on the right hand side and when text editor is selected there is something else on the right hand side. how does this happen? what is added there?
Is it Qt designer form class (.cpp && .h && .ui)?@Joe-von-Habsburg said in Add ready widget into widget:
I am leaving an example
QtCreator Preferences is your example?!
So you want something similar?!You could dig into QtCreator source code and check out how it's done.
For this I would useQToolButtonto populate the "menu bar" on the left and aQStackedWidgetto display the content pages on the right. Actually theQStackedWidgetis more like centered, as the whole window you see is divided into two sections (~15% / ~85%) for the menu and the "rest" (theQStackedWidgetfor the content).Is it Qt designer form class (.cpp && .h && .ui)?
The "right side" is the content widget... In case of QtCreator a custom
QWidgetcontaining aQTabWidgetfor the Text Editor settings among many other things.
The parent of all this is probably aQStackedWidgetas I presumed above.What approach (with or without Designer Form) you pick to implement this has nothing to do with how it works.
Both ways are possible. -
J Joe von Habsburg has marked this topic as solved on