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

QPushButton checked state stylesheet does not apply font styles

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 4.6.1, 4.8.x, 5.0.0, 5.2.0
    • Fix Version/s: 4.8.6, 5.3.0 RC1
    • Component/s: Widgets: Style Sheets
    • Environment:
      Windows XP, Qt Creator 1.3.1, Qt devt. env. 2010.01
      Ubuntu 12.04 64-bit
    • Commits:
      4.8: 65656e03896d12c6dbc37a2ae7d30ec257c26092 5.3: 9ad768fd1999780df18551151b9d9fa9c354131c

      Description

      When I define a style sheet that modifies the font style in checked state (but also in other states) it does not display the text in the selected style.
      I have defined a style that tries to draw the text in bold when the button is in checked state.
      QPushButton:checked

      { font-weight: bold }

      I have tried various style sheets e.g. font: bold or font: 30px
      Setting the color to some other value works, e.g. color: red

      Attached an example application that shows the problem. When clicking on the checkable button, the text becomes red, but not bold.
      Setting another button to bold works, just not in the checked state.

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                mitch_curtis Mitch Curtis
                Reporter:
                rhdv Robert de Vries
              • Votes:
                13 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes