Engauge Digitizer 2
Loading...
Searching...
No Matches
LoadImageFromUrl.h
Go to the documentation of this file.
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#ifdef NETWORKING
12#include <QtNetwork/QNetworkAccessManager>
13#endif
14#include <QObject>
15#include <QString>
16#include "UrlDirty.h"
17
18class MainWindow;
19
21class LoadImageFromUrl : public QObject
22{
23 Q_OBJECT;
24
25public:
27 LoadImageFromUrl(MainWindow &mainWindow);
29
31 void startLoadImage (const UrlDirty &url);
32
33private slots:
34 void slotFinished ();
35 void slotReadData ();
36
37signals:
39 void signalImportImage (QString, QImage);
40
41private:
43
44 void deallocate ();
45
46 MainWindow &m_mainWindow;
47 UrlDirty m_url;
48#ifdef NETWORKING
49 QNetworkAccessManager m_http;
50 QNetworkReply *m_reply;
51#endif
52 QByteArray *m_buffer;
53};
54
55#endif // LOAD_IMAGE_FROM_URL_H
void startLoadImage(const UrlDirty &url)
Start the asynchronous loading of an image from the specified url.
LoadImageFromUrl(MainWindow &mainWindow)
Single constructor.
void signalImportImage(QString, QImage)
Send the imported image to MainWindow. This completes the asynchronous loading of the image.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:95
Adds ability to QUrl to cleanup url path.
Definition UrlDirty.h:16