PDA

View Full Version : Main window



Michiel
19th March 2006, 18:51
Some questions about the main window:

How do you generally set up a QWorkspace as the central widget of a main window? Is it possible in Designer? Or do I have to use code?

QDockWidget? I see you can do something in Designer, but how does that work, exactly? I can put them anywhere, and it'll be 'docked', it seems. Should I simply make it stick to the side with a layout for normal dock widget behaviour? Or might it be better to do the dockwidgets all-code?

In general, how much of the main window do you do in designer and how much in code (except, of course, the behaviour that can only be done with the code)?

Bojan
21st March 2006, 00:54
How do you generally set up a QWorkspace as the central widget of a main window? Is it possible in Designer? Or do I have to use code?

I am not at a computer with Qt now, but if there is a widget for it in the designer, than you can work with it in the designer; if there is no widget for it, than you have to do it all in code.


QDockWidget? I see you can do something in Designer, but how does that work, exactly? I can put them anywhere, and it'll be 'docked', it seems. Should I simply make it stick to the side with a layout for normal dock widget behaviour? Or might it be better to do the dockwidgets all-code?
Hmm I am not exactly sure myself as to how you are suppose to use dockwidgets in the designer, as I have never tried it. See my answer to your next question.


In general, how much of the main window do you do in designer and how much in code (except, of course, the behaviour that can only be done with the code)?
For main windows, I think doing it all in code works better. I find i have much better control over what's setup and how. Usually I use designer for widgets and dialogs because it's a lot faster to do them in the designer, and a lot easier to get the layout(s) right. So the main widget for the main window may be something that is created using designer if needed. Ofcourse, even these things (the ui) are usually customised using the code. So it's really the coded class that is used in the main window. Hope that makes sense. Anyway, that's how I do it.