Engauge Digitizer  2
LoadImageFromUrl.h
1 #ifndef LOAD_IMAGE_FROM_URL_H
2 #define LOAD_IMAGE_FROM_URL_H
3 
4 #include <QImage>
5 #include <QtNetwork/QNetworkAccessManager>
6 #include <QObject>
7 #include <QString>
8 #include <QUrl>
9 
10 class MainWindow;
11 class QUrl;
12 
14 class LoadImageFromUrl : public QObject
15 {
16  Q_OBJECT;
17 
18 public:
20  LoadImageFromUrl(MainWindow &mainWindow);
22 
24  void startLoadImage (const QUrl &url);
25 
26 private slots:
27  void slotFinished ();
28  void slotReadData ();
29 
30 signals:
32  void signalImportImage (QString, QImage);
33 
34 private:
36 
37  void deallocate ();
38 
39  MainWindow &m_mainWindow;
40  QUrl m_url;
41  QNetworkAccessManager m_http;
42  QNetworkReply *m_reply;
43  QByteArray *m_buffer;
44 };
45 
46 #endif // LOAD_IMAGE_FROM_URL_H
void signalImportImage(QString, QImage)
Send the imported image to MainWindow. This completes the asynchronous loading of the image...
Load QImage from url. This is trivial for a file, but requires an asynchronous download step for http...
void startLoadImage(const QUrl &url)
Start the asynchronous loading of an image from the specified url.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:66