Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.2
-
None
-
Linux
-
40894d28748e6f1299180652e4235eafb59ea102
Description
QDockWidget supports placing titlebars either horizontally at the top or vertically up the left edge. When using the Fusion widget style, vertical title bars are positioned correctly, but the text inside them isn't rotated, causing it to run outside the bounds of the titlebar and underneath the dock contents.
The fix is quite straightforward. I fixed it locally by just stealing the following three lines from qwindowsstyle.cpp. I'll try to submit this via Gerrit, but as I've never contributed to Qt before, that may take some time to set up.
diff --git i/src/widgets/styles/qfusionstyle.cpp w/src/widgets/styles/qfusionstyle.cpp
index 41046a1..149a5c6 100644
— i/src/widgets/styles/qfusionstyle.cpp
+++ w/src/widgets/styles/qfusionstyle.cpp
@@ -1219,6 +1219,10 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
- titleRect.bottom(),
r.top() + titleRect.left() - rect.left(),
titleRect.height(), titleRect.width());
+
+ painter->translate(r.left(), r.top() + r.width());
+ painter->rotate(-90);
+ painter->translate(-r.left(), -r.top());
}
if (!dwOpt->title.isEmpty()) {
Attachments
For Gerrit Dashboard: QTBUG-31904 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
59464,1 | Fix rotation of text in vertical QDockWidget titlebars in QFusionStyle. | stable | qt/qtbase | Status: MERGED | +2 | 0 |