QML component display

Can I capture the screen rendering of a QML component and save it in an image file? I would like to control the Component through several different states and capture its visual appearance for documentation purposes, without the need to capture a screen / window.

+4
source share
2 answers

Yes, you can configure state transitions for a call QWidget::grab, then save it to a file through QPixmap.

If you need an example of how to set up the code for the call QWidget::grab, look at this answer: How to make ScreenShot Qt / QML

QPixmap::grabWidget QWidget::grab, QPixmap::grabWidget . QPixmap QWidget::grab, QPixmap, , jpeg, png, gif.

, .

QWidget:: grab

QPixmap

QPixmap:: save

+3

Qt 5.4 grabToImage - QQuickItem.

, , grabToImage(), Window

+2

Source: https://habr.com/ru/post/1524562/


All Articles