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

Documentation of QML font weights is incorrect

    XMLWordPrintable

Details

    • All
    • 1c39eddbd (dev), e3e5462fb (6.6), 67cbfe5a4 (tqtc/lts-6.5)
    • DaVinci 90, DaVinci 91

    Description

      The documentation of qml font weights says that the value is between 0 and 99 and has values for the individual enum items, like 57 for Font.Medium.

      In reality though, the enumeration follows the definition in QFont with 500 for Font.Medium, for example. Exhaustive list:

      import QtQuick
      
      Window {
          id: win
          width: 800
          height: 600
          visible: true
          title: 'weight'
      
          Component.onCompleted: () => {
              console.log('Font.Thin      ', Font.Thin)
              console.log('Font.ExtraLight', Font.ExtraLight)
              console.log('Font.Light     ', Font.Light)
              console.log('Font.Normal    ', Font.Normal)
              console.log('Font.Medium    ', Font.Medium)
              console.log('Font.DemiBold  ', Font.DemiBold)
              console.log('Font.Bold      ', Font.Bold)
              console.log('Font.ExtraBold ', Font.ExtraBold)
              console.log('Font.Black     ', Font.Black)
          }
      }
      

      results in

      qml: Font.Thin       100
      qml: Font.ExtraLight 200
      qml: Font.Light      300
      qml: Font.Normal     400
      qml: Font.Medium     500
      qml: Font.DemiBold   600
      qml: Font.Bold       700
      qml: Font.ExtraBold  800
      qml: Font.Black      900
      

      Attachments

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

        Activity

          People

            treinio Topi Reiniƶ
            moerkb Markus Bader
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes