Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.0 Beta2, 6.10.0 FF
-
None
-
macOS 15.2
Description
Commit aa341ecca816e3503a834ffde0ec6cb817139427 changes how spacing in layouts works with QPushButtons that have a style sheet applied (this style sheet does not need to change anything, it just needs to be there to convert the OS-native button to a Qt one).
Having two QPushButtons on top of each other in a QVBoxLayout, there is now less space between the buttons. When setting the layout spacing to 0, they overlap (instead of having zero spacing).
Reverting said commit brings the behavior back to what it was before.
I've attached images to show the difference (the ones prefixed "dev" are current dev branch behavior, the ones "revert" are with the commit reverted).
Here's a (hopefully minimal) reproducer (also attached as CMake project):
int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setStyleSheet(R"( QPushButton { border-radius: 0px; } QPushButton:hover { background-color: #4d4d4d; } )"); QWidget w; auto lay = new QVBoxLayout(&w); lay->addWidget(new QPushButton("Text")); lay->addWidget(new QPushButton("Also Text")); lay->setSpacing(0); w.show(); return a.exec(); }
I observed this on macOS, and am unable to test on other operating systems.