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

QQuickItem::grabToImage ignores scale factor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.15
    • Quick: SceneGraph
    • None
    • 91e75fc34 (dev)

    Description

      QQuickItem::grabToImage always captures the item with scale factor 1, ignoring retina scale factors. For instance, if an item is drawn with 300x300 pixels on the screen on a device with scale factor 3 then grabToImage will only capture a 100x100 version of the item.

      Can be reproduced with the following QML snippet:

      import QtQuick 2.0
      
      Text {
          width: 200;
          height: 100;
          id: root;
      
          function grab() {
              root.grabToImage(function(result) { result.saveToFile("grab.png"); });
          }
          
          Timer {
              interval: 500; running: true; repeat: false
              onTriggered: grab()
          }
      
          text: "Hello World!"
          font.pointSize: 24
      }
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-50693
          # Subject Branch Project Status CR V

          Activity

            People

              janichol Andy Nichols
              DanielSt Peter Staab
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change