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

Must clarify QML dimension units when using AA_EnableHighDpiScaling

    XMLWordPrintable

Details

    Description

      As opposite to other layout engines (CSS, Android layout etc.), QML doesn't have a concept of dimension units like px, pt and dp.

      If we define a rectangle like this

      Rectangle {
        width: 100
        height: 100
      }
      

      we will obtain a square of size 100*scale px if we set AA_EnableHighDpiScaling.

      Thus the dimension unit is dp instead of true pixels in this case. Which is judicious is most cases. But it is implicit.

      I don't know if we should add units to QML, but at least we should describe how numbers are interpreted by the framework. And more generally how to achieve responsive design with Qt.

      Same apply for font, what is the definition of pointSize and pointPixel?

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            fabricesalvaire fabrice salvaire
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes