Manual中说的很清楚:
void QDockWidget::setTitleBarWidget ( QWidget * widget )
Sets an arbitrary widget as the dock widget's title bar. If widget is 0, the title bar widget is removed, but not deleted.
If a title bar widget is set, QDockWidget will not use native window decorations when it is floated.