Gillou_beginqt last edited by Gillou_beginqt
Is it possible to create a home button from a widget window to the main window
What do you mean ?
If you mean create another widget as window and there then
have a buttons that close the
current windows and shows MainWindow again.
You can also use dialogs and it will pop over the mainwin and when closed then
mainwin is under.
if you making something what would be like pages and do not really need to be windows, the
stacked widget is also good.
@mrjj I want to create navigational button between the main window and subwindows
Well, you can show any window from any window.
Have a look at this mini sample and tell me if that is what you mean or
you have other needs.
@mrjj I want the main window to disappear when you click on win1 and reappear when home is clicked
here is one that does that using signals
Ajith_P_V last edited by
You can use "stacked widget" concept which do what you want.
Please see the below documentation for more details.
@mrjj Your answer is basically what i want to do. Thank you but with many sub windows of sub windows I'll difficult for me. The stackwidget seems adequate for my project
@Ajith_P_V Can you elaborate? I tried the but my program stops
Ajith_P_V last edited by
@Gillou_beginqt Basically, stacked widget is a concept which will show either of the "page(or screen)" at a time. Create a widget project in Qt creator. Drag and drop the stacked widget item from the panel. Then in stacked widget, create your main window page followed by creating your sub window(s) as another page(s). In this way, while running your project, first your main window page will appear with your desired button. When you click on the button, set it to go to the next page (sub window) which also means that, the main window page will get disappear and new page will get displayed! . From your current window page, you can come back to your first page (Main window page) by click on "home" button clicked.
Ajith P V
@Ajith_P_V But If I already created different QWidget windows separately and I want to use the QStacked widget. How can I do it ?
If you created UI files that are based on Widget as parent, you could
place a Widget on the stack page, and use the promote feature (right click)
to get the widgets into the stacked.
@mrjj I have 3 Pages 1 Qmainwindow and 2 sub windows Qwidget:
- Main window
- Movie widget
- Sport widget
I palced the QStackedWidget on my main waindow and placed all the widgets on page 1
On page 2 I promoted to a qwidget movie which is supposed to appear when you click on a button but nothing happens when I clicked
and you switch to the page with
Sounds like you are almost there.
have a look at this sample
@mrjj Thank you !! It's working