Advertisement
Guest User

Untitled

a guest
Sep 1st, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #ifndef IMAGEPROVIDER_H
  2. #define IMAGEPROVIDER_H
  3.  
  4. #include <qdeclarativeextensionplugin.h>
  5. #include <qdeclarativeengine.h>
  6. #include <qdeclarative.h>
  7. #include <qdeclarativeitem.h>
  8. #include <qdeclarativeimageprovider.h>
  9. #include <qdeclarativeview.h>
  10. #include <QImage>
  11. #include <QPainter>
  12. #include <QMap>
  13. #include <QApplication>
  14. #include <QNetworkRequest>
  15. #include <QNetworkReply>
  16. #include <QDebug>
  17.  
  18. class ImageProvider : public QDeclarativeImageProvider, public QObject {
  19.  
  20. public:
  21. ImageProvider();
  22. QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize);
  23. void downloadImage(const QString &url);
  24.  
  25. signals:
  26. void downloadImage_Success(QNetworkReply *reply);
  27.  
  28. private:
  29. QMap<QString, QImage> cachedImages;
  30. QNetworkAccessManager nam;
  31. };
  32.  
  33. #endif // IMAGEPROVIDER_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement