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

QTabBar: Tab size incorrect when using bold font in a style sheet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.5.2, 4.5.3, 4.6.0, 4.6.1, 5.9.4
    • Widgets: Style Sheets
    • None
    • Ubuntu Linux 9.10, Windows XP, Windows 7
    • da632baf34ef2308da04c56c497e115b9d1ad531 (qt/qtbase/dev) 1acffda4dd6e737376a54f9b3775dd3470d5349f (qt/qtbase/6.2)

      To reproduce style the QTabBar with the following style sheet for example:
      QTabBar::tab

      { border: none; height: 25px; font-weight: bold; }

      QTabBar::tab:selected

      { border: 2px solid green; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom: 3px solid #ffffff; }

      The font becomes bold, but place for text stays the same and isn't increased.

      Solution is to check tabWidget->font->bold in designer or programaticaly tabWidget->font()->setBold(true)

      Another solution is to specify bold font for all elements, i.e.:

      • { font-weight: bold; }

      Some info: http://www.qtcentre.org/threads/28068-Style-sheets-and-font-weight-bug

      Actually duplicate of http://bugreports.qt.nokia.com/browse/QTBUG-2202 which is closed by now.

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

            vhilshei Volker Hilsheimer
            trollixx Oleg Shparber
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes