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

Advertised size of QQuickWidget bypasses root item's scale

    XMLWordPrintable

Details

    • Linux/X11

    Description

      Description

      When creating a QQuickWidget, the advertised size from the QML root item is (width, height) despite a scale factor different from 1.

      How to reproduce

      Take this simple QML:

      Rectangle {
         id: myId
         width: 200
         height: 100

      }

       

      The advertised size to QQuickWidget is (200,100) as expected and the rectangle is drawn normally.

       

      Now add a scale factor:

      Rectangle {
         id: myId
         width: 200
         height: 100
         scale: 0.5
      }

      Observed behavior

      We observe that:

      • The advertised size to QQuickWidget is still (200,100)
      • The rectangle is rendered scaled to 0.5 as expected
      • The rectangle is placed at the center of the (200,100) "view".

       

      Even worse with a scale factor of 1.5:

      • The rectangle is bigger than the (200,100) "view"

      Expected behavior

      We expect the advertised size to QQuickWidget will be (100,50), taking into account the scale factor, so there will be no wasted space when scaling down. The same goes for scale factors > 1.

      Attachments

        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
            dextermagnific Dexter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes