PDA

View Full Version : Which widget should I use to get a normal program window?



TriKri
28th May 2010, 22:37
Hi, I've been using QDialog as my main window, but it has just a close button in the upper right corner, and no minimize and no maximize button, which I want. And it closes down when I press escape, which I don't want it to do. So I figured that QDialog is probably not the widget I want. So which widget do I want to use? I tried QMainWindow, but then no of the widgets I added to it showed up, and the window turned white inside (instead of the light grey color it usually gets). Did I maybe use the QMainWindow wrong? It really sounds like it could be the widget I want, although I'm not sure about it.

Zlatomir
28th May 2010, 23:01
I use QWidget or QMainWindow for that.
But if you create a GUI project, Qt Creator automatically creates MainWindow witch is derived from QMainWindow.

You can create a QWidget in witch you layout other stuff, and then MainWindow variable call setCentralWidget(your_widget).
Hope i was clear enough...