Screenshot of qquickview



  • Hi,

    we have quite a big application and part of it is showing all kinds of different plots (QtCharts). I need to be able to generate an automatic html report containing images of these plots. I already manage to generate a plot in an automated way and pop it up on the screen in a separate window (my own class, inherited from qquickview which loads a source file with the plot), but I don't succeed in saving it to an image which isn't empty. I mean, i know that I can use the grabWindow method from the qquickview and I can do it in a manual way (eg. clicking a button which calls the grabWindow method of the qquickview), but I cannot seem to find a way to do it automatically, so waiting until the plot is fully loaded and then taking the image (and closing the window again). Anybody has an idea on how to implement such functionality?
    Regards,

    Jan


  • Qt Champions 2016

    Hi
    I never used QML but i was wondering
    Does qquickview have the render function ?
    http://doc.qt.io/qt-5/qwidget.html#render



  • A loader onloaded will do the trick i guess. The problem is that i fill the underlying chartview from javascript. Will have to refactor it a little bit to solve, but i'm glad i found the problem and possible solution.

    Jan


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.