PDA

View Full Version : Advice Req: Moving MDI GUI to SDI with Auxiliary Windows



ChrisW67
19th October 2009, 08:45
I'm in the throws of redeveloping a VB3 (Yes! VB3) application into Qt. The original app is an MDI GUI layout: there's only a single document open, but multiple MDI child windows present different views on the same data. One of the child windows is the master view; closing it closes the application. The other views (child windows) are opened and closed on demand, and most have a corresponding print version. Maximising a child window maximises them all, which is ugly for windows that have a natural small size.

I'd like to rearrange the Qt version to have a QMainWindow containing the master view, and separate sub-ordinate windows for the alternate views. Each alternate view should have a couple of actions (Close, Print and maybe others). I can see a few ways to do it;

A QMainWindow derivative for each subordinate view.
A modeless QDialog for each subordinate view.
A bare QWidget for each subordinate view
Each subordinate view would be allocated on the heap, shown, and hidden/destroyed as required. The first option gives me menus and toolbar support trivially. I'm not sure if the other ways can support a toolbar/menu.

Is there some received wisdom on the "best" way to approach this?

Cheers,
Chris

axeljaeger
19th October 2009, 09:28
Dialog and widget do not make a big difference. I'd go either for mainwindow or widget. Take the mainwindow if you want to have more than one toolbar. You can add one toolbar to a widget quite easily using a box-layout. If you want to have more than one, designing them using Qt Designer is the way to go I think and then you will have to use a mainwindow.

ChrisW67
20th October 2009, 04:05
After having a quick prototype I think the main window is the approach I'll take.