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

Not possible to make contentItem bold without also losing font properties

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.14.1
    • Quick: Controls 2
    • None
    • All

    Description

      We want to apply the bold attribute to the font of a Button's label (the label only, not the whole control), but this is not possible as the following is ill-formed:

      font: control.font
      font.bold: true
      

      We had to wrap IconLabel in a Control to allow the extra level of indirection by setting bold on the wrapping control and then explicitly propagating the new font to IconLabel:

      contentItem: Control {
        id: ctrl
        font.bold: true
        background: IconLabel { font: ctrl.font }
      }
      

      A simple fix of changing the base class of QQuickIconLabel would probably do the trick and at the same time allow to simplify existing code of QQ.Controls.2 by removing those explicit propagations.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              wwysota Witold Wysota
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes