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

Item.grabToImage does not work for Window.contentItem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9
    • 5.7.0, 5.8.0
    • None
    • Tested on macOS 10.12.1 and Ubuntu 16.04.1

    Description

      The following snippet prints this stderr:
      Item::grabToImage: no QML Engine

      import QtQuick 2.5
      import QtQuick.Window 2.2
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Component.onCompleted: {
              contentItem.grabToImage(function (image) {
                  image.saveToFile("screenshot.png")
              })
          }
      }
      

      Attachments

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

        Activity

          People

            wearyinside Oleg Yadrov
            louai Louai Al-Khanji
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes