[Interest] [QtQuickTest] grabImage crash

Ben Lau xbenlau at gmail.com
Wed May 7 10:07:25 CEST 2014


I am using Qt Quick Test to test QML component.  I found that the
QQuickView associated with the test component is not visible . No window
widget is launched in Linux and Mac. So I would like to try the grabImage
function to save as a screenshot for verification. However, it will make
the application crashes.

Example code:

import QtQuick 2.0

import QtTest 1.0

Rectangle {

    id : win

    width: 480

    height: 640

    color : "black";

    TestCase {

        function test_basic(){


            var image = grabImage(win);




It has been tested on Mac with Qt 5.2.1 and Linux with Qt 5.3.1 RC
version. The results are same.

Did I missed any step in initialization? I have already tried to
declare a QApplication before calling quick_test_main.

Thank for any advice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140507/ccf78827/attachment.html>

More information about the Interest mailing list