Since we don't have any files in our FTP directory yet (except the file list), let's write the code to allow us to upload our first file.
- First, open mainwindow.ui and right click on the Open button. Then, select Go to slot and select the clicked() option:
- A slot function will be automatically created for you. Then, add the following code to the function to open up the file selector window for our users to select their desired file for upload:
void MainWindow::on_openButton_clicked() { QString fileName = QFileDialog::getOpenFileName(this, "Select
File", qApp->applicationDirPath()); ui->uploadFileInput->setText(fileName); }
- After that, repeat this step and do the same for the Upload button. This time, the code for its slot function looks something like the following:
void MainWindow::on_uploadButton_clicked...