00001
00002
00003
00004
00005
00006
00007 #ifndef LOAD_IMAGE_FROM_URL_H
00008 #define LOAD_IMAGE_FROM_URL_H
00009
00010 #include <QImage>
00011 #include <QtNetwork/QNetworkAccessManager>
00012 #include <QObject>
00013 #include <QString>
00014 #include <QUrl>
00015
00016 class MainWindow;
00017 class QUrl;
00018
00020 class LoadImageFromUrl : public QObject
00021 {
00022 Q_OBJECT;
00023
00024 public:
00026 LoadImageFromUrl(MainWindow &mainWindow);
00027 ~LoadImageFromUrl();
00028
00030 void startLoadImage (const QUrl &url);
00031
00032 private slots:
00033 void slotFinished ();
00034 void slotReadData ();
00035
00036 signals:
00038 void signalImportImage (QString, QImage);
00039
00040 private:
00041 LoadImageFromUrl();
00042
00043 void deallocate ();
00044
00045 MainWindow &m_mainWindow;
00046 QUrl m_url;
00047 QNetworkAccessManager m_http;
00048 QNetworkReply *m_reply;
00049 QByteArray *m_buffer;
00050 };
00051
00052 #endif // LOAD_IMAGE_FROM_URL_H