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

QQuickItem: provide a way to convert to QImage.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • 5.4.0
    • 5.2.1
    • Quick: SceneGraph
    • None
    • Linux, such as Ubuntu.

    Description

      In Qt 4.8.5, there is a way to convert QDeclarativeItem to QImage with the help of QGraphicsItem::paint(), as QDeclarativeItem is a derived class of QGraphicsItem.

      In Qt 5.2.1, I can't find a similar way to convert QQuickItem to QImage, as its main parent class QObject does not provide a paint() function. The derived class QQuickPaintedItem has a paint() function which is pure virtual, so it's not possible to instantiate it. The referenced QQuickWindow() has a function grabWindow() which returns QImage, but this function can only be called from the GUI thread and the window must be invisible.

      Can you add a mechanism to allow converting QQuickItem to QImage, as this is quite often needed in real-world QML applications? Thanks!

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            jonathanz Jonathan Zhong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes