PDA

View Full Version : desing MainWindow like Qt Creator



ReasyEasyPeasy
15th July 2015, 23:11
Hey guys,
first of all english is not my first language so im sorry for my rough english.

I want to creat a mainwindow and i got some problems to design it.
1. How i build an application with only one window and a menu? I call "setCentralWidget" and swap with this between my widgets if the user click on a button in the menu?
2.I want to have small menu like in the qt creater(Welcome, Edit, design...). How i realise it. There are already a class for this? Maybe i have to use the QDockWidget and modify it?


greets

d_stranz
15th July 2015, 23:22
For the menu, you can use QDockWidget (with your own custom widget inside it to contain the buttons) and use QStackedWidget as the central widget of the main window.

Or, you can use QSplitter as the central widget and split it horizontally into the menu on the left and a QStackedWidget on the right.

In both cases, you create new widgets for each "page" and put them into the QStackedWidget, and you use the push button clicks to switch between different widgets in the stack.

ReasyEasyPeasy
15th July 2015, 23:28
thanks for this fast answer i will try it :).