Unsolved how to change the color of title bar in mdi window
-
when mdi subwindow is added to mdiArea, how can I change its title bar color? thanks
-
Hi
You can a bit via stylesheet but it loses icon.
QMdiSubWindow { border: 1px solid #00ff00; background: #ff00ff }
QMdiSubWindow:title { background: #00ff00 } -
@mrjj it works, thank you. and how can I add the lost icons
-
@johnson54
I dont think you can with stylesheets. seems to be no tag for it. -
main.cpp
#include <QStyleFactory> ... QApplication a(argc, argv); a.setStyle(QStyleFactory::create("Fusion")); ...
or only for mdiwin
QMdiSubWindow *subwin=ui->mdiArea->addSubWindow(mywidget); subwin->setAttribute(Qt::WA_DeleteOnClose); subwin->setStyle(QStyleFactory::create("Fusion"));
style.css
... QMdiSubWindow{ selection-background-color: grey;/*for some styles it also used as title bar main gradient color...*/ padding: 4px;/*need for resize window with mouse*/ border-color: lightgray; background: black; } ...