Faster alternative for grabWindow?
-
I ported my app from QtQuick 1.1 to QtQuick 2.1.
It has a build in 'remote desktop' feature. For this I need a screen capture of the complete window relatively fast.
In version 1.1 I used the render() on the GLWidget and was fast enough. However this does not exist in a QtQuick 2.1 QQuickView application, so resorted to the grabWindow method. Which works but is way too slow for my application, just like the "grabWindow":http://qt-project.org/doc/qt-5.0/qtquick/qquickwindow.html#grabWindow documentation warns about.So I'm looking for a faster way to get a complete screenshot into a QImage of the QQuickView content.
I tried using the solution using QOpenGLFramebufferObject as described in "this":http://stackoverflow.com/questions/17146747/capture-qml-drawing-buffer-without-displaying.
This gives screenshot images fast enough (10times faster than grabWindow), but this post's solution renders to an image and no longer to the screen.
Also the documentation of the QQuickWindow::afterRendering() mentions this signal can be used to do 'screen scrapping' but I have no clue how to do that. I guess accessing the GLContext and somehow rendering it to an image/texture or something.Somebody any idea?