I think I understand what you were trying to do and know one reason you might want to do that is the ease of creating a dock widget in the designer (outside of the mainframe form) that you can reuse. Yeah, there are other ways of doing it, but that is the most intuitive (for me anyway).
In order to do what you are trying to do, call your QDockWidget sub-class setupUI (assuming you did the multiple-inheritance way of subclassing using designer forms) after the mainframe has done all its setupUi stuff, not in your sub-class's constructor.
That should do what you want.
Bookmarks