user704010
user704010

Reputation:

Another Window over QMainWindow in Qt

Can i have another window over main window in Qt , and how can i implement it? I have a plugin which must return another window. I created in plugin a QWidget and set it as centralWidget but my app crashes.Anyway this will not show two windows at same time . Could someone explain how to do that ?

Upvotes: 1

Views: 332

Answers (1)

jkerian
jkerian

Reputation: 17016

Any new widget created without a parent will show up as a new window. Don't try to reset 'centralWidget' unless you don't actually want the old one anymore.

If all you want is a main window whose contents change, take a look at StackedWidget.

Upvotes: 2

Related Questions