fork download
  1. #ifndef IMGD_H
  2. #define IMGD_H
  3.  
  4. #include <QObject>
  5. #include <QByteArray>
  6. #include <QNetworkAccessManager>
  7. #include <QNetworkRequest>
  8. #include <QNetworkReply>
  9. #include <QtWidgets>
  10. #include <QWebView>
  11.  
  12. class ImgD : public QObject
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit ImgD();
  17.  
  18. virtual ~ImgD();
  19. QWidget* getWidget() { return &widg;}
  20.  
  21. signals:
  22. void downloaded(QString);
  23.  
  24. private slots:
  25.  
  26. void fileDownloaded(QNetworkReply* pReply);
  27. void download();
  28. void startDownload(bool);
  29. void start();
  30. void loadImage(QString);
  31.  
  32. private:
  33.  
  34. QWidget widg;
  35. QBoxLayout* mainLayout;
  36. QLineEdit* urlEdit;
  37. QPushButton* button;
  38. QLabel* info;
  39. QWebView view;
  40. QUrl* url;
  41.  
  42. QNetworkAccessManager m_WebCtrl;
  43.  
  44. QByteArray m_DownloadedData;
  45.  
  46. };
  47.  
  48. #endif
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:19: fatal error: QObject: No such file or directory
 #include <QObject>
                   ^
compilation terminated.
stdout
Standard output is empty