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

Downloading files from the FTP server

Now that we have successfully uploaded our first file to the FTP server, let's create the feature for downloading the file back onto our computer!

  1. First, open mainwindow.ui again and right-click on the Set Folder button. Select Go to slot... and pick the clicked() signal to create a slot function. The slot function is very simple; it will just open up a file selection dialog, but this time it will only let the user select a folder instead since we provided it with a QFileDialog::ShowDirsOnly flag:
void MainWindow::on_setFolderButton_clicked() { QString folder = QFileDialog::getExistingDirectory(this, tr("Open Directory"), qApp->applicationDirPath(), QFileDialog::ShowDirsOnly); ui->downloadPath->setText(folder); ...
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