Details
-
Suggestion
-
Resolution: Done
-
Not Evaluated
-
5.2.1
-
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!