Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef IMAGEPROVIDER_H
- #define IMAGEPROVIDER_H
- #include <qdeclarativeextensionplugin.h>
- #include <qdeclarativeengine.h>
- #include <qdeclarative.h>
- #include <qdeclarativeitem.h>
- #include <qdeclarativeimageprovider.h>
- #include <qdeclarativeview.h>
- #include <QImage>
- #include <QPainter>
- #include <QMap>
- #include <QApplication>
- #include <QNetworkRequest>
- #include <QNetworkReply>
- #include <QDebug>
- class ImageProvider : public QDeclarativeImageProvider, public QObject {
- public:
- ImageProvider();
- QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize);
- void downloadImage(const QString &url);
- signals:
- void downloadImage_Success(QNetworkReply *reply);
- private:
- QMap<QString, QImage> cachedImages;
- QNetworkAccessManager nam;
- };
- #endif // IMAGEPROVIDER_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement