As of Qt 5.2
you can't; haven't checked 5.3
but AFAIK they didn't changed anything in the QMdiArea/QMdiSubWindow
in the 5.3
release.
The easiest solution you have is to use QCommonStyle
and paint the title bar using QPainter
. For more info on that see the QCommonStyle and QStyle documentations. Please note that it is recommended to derive QCommonStyle
and not QStyle
for your style class. QCommonStyle
inherits QStyle
so you won't loose anything.
And if you want to achieve more complex effects such as drop shadow on the sub window then the only option you have left here is to derive QMdiSubWindow
and QMdiArea
, call QWidget::setWindowFlags(Qt::FramelessWindowHintflag)
on the QMdiSubWindow
derived class and implement from scratch your own subwindow with your own title bar. You can then define your own Q_PROPERTY
s of type QColor
and access those from QSS
like exposed here in order to customize titlebar colors from QSS
.
Another option would be to create a new MDI area widget from scratch but I don't think this would be applicable in your case. If you just need to customize the title bar using a custom style is the best approach you can tackle. If in trouble examples could be provided as an edit to this post.
But if you want to customize the standard QMdiSubWindow
using just QSS
, unfortunately it is not possible for the moment.