Displaying the file list on the list view
In the previous section, we successfully set up a FTP server and kept it running. In the following section, we will learn how to create an FTP client program that displays the file list, uploads files to the FTP server, and finally downloads files from it.
Setting up a project
As usual, let's create a new project using Qt Creator. The following steps will help:
- We can create a new project by going to
File|New File or Projectand selectingQt Widgets Application. - Once your project has been created, open your project (
.pro) file and add thenetworkkeyword so that Qt knows that you need theNetworking modulein your project:
QT += core gui networkSetting up user interface
After that, open up mainwindow.ui and perform the following steps to design the upper part of our user interface for uploading files:
- Place a
Labelthat saysUpload File:on top of every other widget. - Put a horizontal layout and two
Push Buttonsalongside it that sayOpenandUpload, under...