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 Project
and selectingQt Widgets Application
. - Once your project has been created, open your project (
.pro
) file and add thenetwork
keyword so that Qt knows that you need theNetworking module
in your project:
QT += core gui network
Setting 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
Label
that saysUpload File:
on top of every other widget. - Put a horizontal layout and two
Push Buttons
alongside it that sayOpen
andUpload
, under...