2019-07-29 15:29:07 +03:00
|
|
|
#ifndef ASYNCIMAGERESPONSE_H
|
|
|
|
#define ASYNCIMAGERESPONSE_H
|
|
|
|
|
|
|
|
#include <QQuickImageResponse>
|
|
|
|
|
|
|
|
|
|
|
|
class AsyncImageResponse : public QQuickImageResponse {
|
|
|
|
|
|
|
|
private:
|
|
|
|
QQuickTextureFactory *_texture = nullptr;
|
2019-07-29 19:48:22 +03:00
|
|
|
QString _errorString;
|
2019-07-29 15:29:07 +03:00
|
|
|
public:
|
|
|
|
|
|
|
|
AsyncImageResponse ();
|
|
|
|
~AsyncImageResponse () override;
|
|
|
|
|
|
|
|
QQuickTextureFactory *textureFactory() const override;
|
|
|
|
|
|
|
|
void setResult(const QImage &image);
|
2019-07-29 19:48:22 +03:00
|
|
|
void error(const QString &err);
|
|
|
|
|
|
|
|
QString errorString() const override;
|
2019-07-29 15:29:07 +03:00
|
|
|
};
|
|
|
|
#endif // ASYNCIMAGERESPONSE_H
|