Okay, I found a workaround: I define a CSS border for my QGroupBoxes which imitates thre Breeze look so that the native style isn't used, along with a property for the ones without a title, and I only use it if the Fusion style is used.
main.cpp:
if (application.style()->objectName() == QLatin1String("fusion")) {
application.setStyleSheet(QStringLiteral(R"END(
QGroupBox {
border: 1px solid palette(Mid);
border-radius: 2px;
padding-top: 1.2em;
}
QGroupBox[notitle=true] {
padding-top: 0;
}
QGroupBox::title {
background-color: transparent;
subcontrol-origin: margin;
subcontrol-position: top center;
padding: 0.4em 0 0;
}
QScrollArea {
background-color: transparent;
}
)END"));
}
If a QGroupBox doesn't have a title, I define the notitle property:
someBox->setProperty("notitle", true);
The result is quite nice, although this is surely more a hack; but the only code to change are the setProperty calls that are simply ignored by the styles drawing the QGroupBoxes correctly:
[image: b03b050e-592d-4a45-9215-3fd2133f974a.png]
Well, it works ;-)