MuseScore  3.4
Music composition and notation
downloadUtils.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2002-2013 Werner Schweer
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __DOWNLOAD_UTILS_H__
14 #define __DOWNLOAD_UTILS_H__
15 
16 namespace Ms {
17 
18 class DownloadUtils : public QObject
19  {
20  Q_OBJECT
21 
22  QByteArray sdata;
23  QNetworkAccessManager manager;
24  QString _target;
25  QString _localFile;
26 
27  QProgressDialog* progressDialog = nullptr;
28 
29  public:
30  explicit DownloadUtils(QWidget *parent=0);
31 
32  void setTarget(const QString& t) { _target = t; }
33  void setLocalFile(const QString& t) { _localFile = t; }
34  bool saveFile();
35  QByteArray returnData();
36 
37  signals:
38  void done();
39 
40  public slots:
41  void download(bool showProgress = false);
42  void downloadFinished(QNetworkReply* data);
43  void downloadProgress(qint64 received, qint64 total);
44  };
45 }
46 
47 #endif
48 
QByteArray sdata
Definition: downloadUtils.h:22
QByteArray returnData()
Definition: downloadUtils.cpp:42
QProgressDialog * progressDialog
Definition: downloadUtils.h:27
void setLocalFile(const QString &t)
Definition: downloadUtils.h:33
DownloadUtils(QWidget *parent=0)
Definition: downloadUtils.cpp:17
QNetworkAccessManager manager
Definition: downloadUtils.h:23
Definition: aeolus.cpp:26
QString _target
Definition: downloadUtils.h:24
bool saveFile()
Definition: downloadUtils.cpp:22
void downloadFinished(QNetworkReply *data)
Definition: downloadUtils.cpp:36
void setTarget(const QString &t)
Definition: downloadUtils.h:32
QString _localFile
Definition: downloadUtils.h:25
void download(bool showProgress=false)
Definition: downloadUtils.cpp:47
Definition: downloadUtils.h:18
void downloadProgress(qint64 received, qint64 total)
Definition: downloadUtils.cpp:77