Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to dynamically embed a window inside of mainwindow?
I searched a lot but I didn't find any proper solution.
I want to embed a second window inside of mainwindow. Mainwindow will have a tree structure, If user clicks an element in tree, an area in mainwindow will be loaded with new window. Each element in tree will have a GUI, that will be loaded if this element is clicked in tree.
How can I do that? Is there any example project for that?
you could add your widgets to a QStackedWidget and switch it's current index.
What do yo u mean by window?
If its embedded into mainwindow , its not really a window anymore.
Is this "other" window from same application, you do you mean a foreign
So as @raven-worx ask, is this more of a page concept ? where clicking in the tree will switch "page"?
Hi, Thanks for answers.
"Embedding" is maybe a wrong wording.
Lets say, I have 5 different classes with their own GUIs (Widgets?) I want to show them inside of main program if I click a tree element.
For example in the mainwindow I have a tree at left, and empty place on right. If I click first element in tree, epmty area shall be filled with GUI of first class. If I click second element on tree, epmty area shall be filled with GUI of second class and so on.
It does sound like QStackedWidget would be perfect match. :)
Thanks for answer and sorry for late answer :)
@mrjj . I will have a look.
I try to execute this code, I am getting always linker error : :-1: error: LNK1104: cannot open file 'corelibc.lib'.
Is there a better sample code for PC? In Pro file there is a line :
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
Is it for WinCE OS? I need it for win8.1
try to remove this line from the pro-file (and rerun qmake afterwards)
But configdialog.cpp should contain all you need and it's pretty straight forward.
Thanks. It worked now!