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 ()

静态公共成员

const QMetaObject staticMetaObject

额外继承成员

详细描述

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

另请参阅 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 .