QQuickItemGrabResult Class

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

頭: #include <QQuickItemGrabResult>
qmake: QT += quick
實例化: ItemGrabResult
繼承: QObject

特性

公共函數

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

信號

void ready ()

詳細描述

另請參閱 QQuickItem::grabToImage ().

特性文檔編製

image : const QImage

This 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() 將返迴 true ).

訪問函數:

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 類型。

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.

訪問函數:

QUrl url () const

成員函數文檔編製

[signal] void QQuickItemGrabResult:: ready ()

This signal is emitted when the grab has completed.

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

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

注意: In Qt versions prior to 5.9, this function is marked as non- const .

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .