Qt 5.7 | Qt Quick | C++ Classes | QQuickItemGrabResult

Qt 5.7.1 Reference Documentation

# QQuickItemGrabResult Class

The QQuickItemGrabResult contains the result from QQuickItem::grabToImage(). More...

Header: | #include <QQuickItemGrabResult>
qmake: | QT += quick
Instantiated By: | ItemGrabResult

- List of all members, including inherited members

## Properties

- image : const QImage
- url : const QUrl

## Public Functions

QImage | image() const
bool | saveToFile(const QString &fileName)
QUrl | url() const

## Signals

void | ready()

## Detailed Description

The QQuickItemGrabResult contains the result from QQuickItem::grabToImage().

See also QQuickItem::grabToImage().

## Property Documentation

### image : const QImage

This property holds the pixel results from a grab.

If the grab is not yet complete or if it failed, an empty image is returned.

Access functions:

QImage | image() const

### url : const QUrl

This 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

## Member Function Documentation

### `[signal]` void QQuickItemGrabResult::ready()

This signal is emitted when the grab has completed.

### bool QQuickItemGrabResult::saveToFile(const QString &fileName)

Saves the grab result as an image to fileName. Returns true if successful; otherwise returns false.