If I understand your code correctly, your MainWindow and BaseWindow are both top-level windows (they have no "parent" - they are children of the desktop window). This makes them "sibling" windows, and so you may be able to use the QWidget::stackUnder() method. When you make BaseWindow visible, call MainWindow->stackUnder( BaseWindow ) and vice-versa. I don't know if it will work, but it is worth trying.
Bookmarks