How to Create MDI Style Interfaces

Normally when you create an application, you create a QMainWindow as your main window and add menus etc... In an MDI application, you want to allow menu actions to open a window in the space below the menu.

The question that you normally ask yourself is what type do you use for these subwindows? Is the type of the new window also a QMainWindow (the child window) without menus?

It turns out that this is the wrong approach. You can only create these subwindow inside a QWorkspace widget - which acts as a container for the other QWidgets. These child QWidgets are then rendered as MDI child windows.

For more information: http://doc.trolltech.com/3.2/qworkspace.html

See also: PyQt MDI Example A Simple MDI Pattern

Sources: http://mats.imk.fraunhofer.de/pipermail/pykde/2004-May/007850.html & replies

(Summarised by MichaelSamuels)

CreatingMdiApplications (last edited 2005-04-09 13:04:19 by )