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

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.0.2
    • Fix Version/s: 5.1.1
    • Component/s: Widgets: Main Window
    • Labels:
      None
    • Environment:
      Linux
    • Commits:
      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

          Activity

            People

            Assignee:
            parkotron Parker Coates
            Reporter:
            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