Skip to Content
Hands-On GUI Programming with C++ and Qt5
book

Hands-On GUI Programming with C++ and Qt5

by Lee Zhi Eng
April 2018
Intermediate to advanced
404 pages
8h 27m
English
Packt Publishing
Content preview from Hands-On GUI Programming with C++ and Qt5

Writing the code

Next, open up mainwindow.h and add the following headers:

#include <QMainWindow> 
#include <QDebug> 
#include <QNetworkAccessManager> 
#include <QNetworkRequest> 
#include <QNetworkReply> 
#include <QFile> 
#include <QFileInfo> 
#include <QFileDialog> 
#include <QListWidgetItem> 
#include <QMessageBox> 

After that, add in the following variables and functions:

private: 
   Ui::MainWindow *ui; 
   QNetworkAccessManager* manager; 
 
   QString ftpAddress; 
   int ftpPort; 
   QString username; 
   QString password; 
 
   QNetworkReply* downloadFileListReply; 
   QNetworkReply* uploadFileListReply; 
 
   QNetworkReply* uploadFileReply; 
   QNetworkReply* downloadFileReply; 
 
   QStringList fileList; 
   QString uploadFileName; 
   QString downloadFileName; public:   void getFileList();

Once you ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ GUI Programming with Qt 4

C++ GUI Programming with Qt 4

Jasmin Blanchette, Mark Summerfield

Publisher Resources

ISBN: 9781788397827Supplemental Content