This is a subclass of one of the KDE MDI window classes. It supports child windows that can be on-the-fly converted back and forth among the following modes:

Each child window corresponding has a menu button in the main window's toolbar (the three here being “Python”, “child1”, and “child2” along the top, under the menubar).

Clicking on one of these buttons will toggle the child window's visibility (no matter which of the three states it is in). All three buttons in this picture are shown in a toggled-on state, or depressed, because all the child windows that correspond to these buttons are currently visible.

Clicking and holding on one of these buttons will pop up a window control menu for that child. Through this menu, the child window can have it's state changed to any of the three above states; also MDI windows can have their geometry changed.

The tool windows (like normal KDE tool windows) can be dragged around the MDI area to stick them at any place you like.

I made this because I could never decide if a window should be a tool window or an MDI window, or a free-floating window.

I still haven't figured out how to save a layout using the KDE XML window description feature; fortunately, I can explicitly code window layouts as a series of Python statements, and save and replay these statements to restore a particular layout.