http://qt-project.org/doc/qt-4.8/qdockwidget.html#topLevelChanged
void QDockWidget::topLevelChanged ( bool topLevel ) [signal]
This signal is emitted when the floating property changes. The topLevel parameter is true if the dock widget is now floating; otherwise it is false.
So you can connect it to a slot that maximizes the widget if topLevel is true