Quote Originally Posted by wysota View Post
Your widget is not a subclass of QMdiSubWindow. You will get a focusIn event for the widget itself, provided that the widget itself accepts focus.
OK, it got too many problems, such as when I call QMdiArea::tileSubWindows or QMdiArea::cascadeSubWindows, the QMdiSubWindow::moveEvent got called and all the subwindows are detached from the QMdiArea.

So I decide to override QMdiSubWindow's system menu by adding "Detach from Work Area" and "Attach to Work Area". The "Detach from Work Area" is added correctly to the QMdiSubWindow's system menu. However, after it is detached, the window becomes a standalone window and the window manager's system menu is used. I lose those menu items that I have added...

Is there a way to solve this?