Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31904

In Fusion style, the text in vertical QDockWidget titlebars isn't rendered vertically.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.1.1
    • 5.0.2
    • Widgets: Main Window
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            parkotron Parker Coates
            parkotron Parker Coates
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes