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!
- First, open
mainwindow.uiagain and right-click on theSet Folderbutton. SelectGo to slot...and pick theclicked()signal to create aslotfunction. Theslotfunction 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 aQFileDialog::ShowDirsOnlyflag:
void MainWindow::on_setFolderButton_clicked()
{
QString folder = QFileDialog::getExistingDirectory(this, tr("Open Directory"), qApp->applicationDirPath(), QFileDialog::ShowDirsOnly);
ui->downloadPath->setText(folder);
} - Then, right click on the
List Widgetand selectGo to slot...This time around, we will pick theitemDoubleClicked(QListWidgetItem*)option instead:

- When the user double-clicks on an item in the
List Widget, the following function...