The QQuickItemGrabResult contains the result from QQuickItem::grabToImage(). More...
| Header: | #include <QQuickItemGrabResult> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick)target_link_libraries(mytarget PRIVATE Qt6::Quick) |
| qmake: | QT += quick |
| In QML: | ItemGrabResult |
| Inherits: | QObject |
| QImage | image() const |
| bool | saveToFile(const QString &fileName) const |
(since 6.2) bool |
saveToFile(const QUrl &filePath) const |
| QUrl | url() const |
| void | ready() |
See also QQuickItem::grabToImage().
[read-only] image : const QImageThis property holds the pixel results from a grab.
If the grab is not yet complete or if it failed, a null image is returned (image.isNull() will return true).
Access functions:
| QImage | image() const |
[read-only] url : const QUrlThis property holds a URL which can be used in conjunction with URL based image consumers, such as the QtQuick::Image type.
The URL is valid until the QQuickItemGrabResult object is deleted.
The URL does not represent a valid file or location to read it from, it is primarily a key to access images through Qt Quick's image-based types.
Access functions:
| QUrl | url() const |
[signal] void QQuickItemGrabResult::ready()This signal is emitted when the grab has completed.
[invokable] bool QQuickItemGrabResult::saveToFile(const QString &fileName) constSaves the grab result as an image to fileName. Returns true if successful; otherwise returns false.
Note: In Qt versions prior to 5.9, this function is marked as non-const.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
[invokable, since 6.2] bool QQuickItemGrabResult::saveToFile(const
QUrl &filePath) constSaves the grab result as an image to filePath, which must refer to a local file name with a supported image
format extension. Returns true if successful; otherwise returns false.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
This function was introduced in Qt 6.2.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: