Engauge Digitizer 2
Loading...
Searching...
No Matches
LoadImageFromUrl.h
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef LOAD_IMAGE_FROM_URL_H
8#define LOAD_IMAGE_FROM_URL_H
9
10#include <QImage>
11#include <QtNetwork/QNetworkAccessManager>
12#include <QObject>
13#include <QString>
14#include <QUrl>
15
16class MainWindow;
17class QUrl;
18
20class LoadImageFromUrl : public QObject
21{
22 Q_OBJECT;
23
24public:
26 LoadImageFromUrl(MainWindow &mainWindow);
28
30 void startLoadImage (const QUrl &url);
31
32private slots:
33 void slotFinished ();
34 void slotReadData ();
35
36signals:
38 void signalImportImage (QString, QImage);
39
40private:
42
43 void deallocate ();
44
45 MainWindow &m_mainWindow;
46 QUrl m_url;
47 QNetworkAccessManager m_http;
48 QNetworkReply *m_reply;
49 QByteArray *m_buffer;
50};
51
52#endif // LOAD_IMAGE_FROM_URL_H
Load QImage from url. This is trivial for a file, but requires an asynchronous download step for http...
void signalImportImage(QString, QImage)
Send the imported image to MainWindow. This completes the asynchronous loading of the image.
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:78