PDA

View Full Version : QMainWindow in StackedWidget



FlyingEagle
12th November 2019, 15:15
Hi,

i have a small application made with QT and QMainWindow, and now I want to write a second one that combines this two applications.

What I want to do is:

- have Mainmenu in Form1
- Button that opens Form2
- Form2 opens in StackedWidget

I copied all cpp/h/ui into my project folder.

When i show the Form2 with _Form2.show(); it opens and closes in a second.

When I use setCentralWidget than my Form2 would be displayed but no slot works.

Compared to VB.NET: I want to have Custom-Usercontrols with all my Widgets and Code in a separate cpp/h/ui.

Regards

Ginsengelf
12th November 2019, 15:20
Please show us some code.

Ginsengelf

FlyingEagle
12th November 2019, 15:58
I have no Code yet - not for the "thing" i want to do ;-)

FORM2 * _frm2= new FORM2;
_frm2->show ();

I found this to show the Form2 as second opened window - and it works.

But i want the 2nd Window in the StackedWidget on Form1