Q:

PyQt5 problem with QTreeView, do not show folders

I am trying to build simple FTP client in Python and for GUI I use PyQt5. Problem is when I run program QTreeView do not showing directories, it is just blank surface. How can I code this to show folders and how to link with this listView below? I was looked on Google but I can not resolve this.
This window I get

And I want something like this

Code:
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(852, 637)
        MainWindow.setAnimated(True)
        MainWindow.setDocumentMode(False)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.connectButton = QtWidgets.QPushButton(self.centralwidget)
        self.connectButton.setGeometry(QtCore.QRect(710, 20, 111, 21))
        self.connectButton.setObjectName("connectButton")
        self.usernameEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.usernameEdit.setGeometry(QtCore.QRect(180, 20, 161, 20))
        self.usernameEdit.setObjectName("usernameEdit")
        self.passEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.passEdit.setGeometry(QtCore.QRect(350, 20, 161, 20))
        self.passEdit.setObjectName("passEdit")
        self.portEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.portEdit.setGeometry(QtCore.QRect(520, 20, 161, 20))
        self.portEdit.setReadOnly(False)
        self.portEdit.setObjectName("portEdit")
        self.hostEdit = QtWidgets.QLineEdit(self.centralwidget)
        self.hostEdit.setGeometry(QtCore.QRect(10, 20, 161, 20))
        self.hostEdit.setText("")
        self.hostEdit.setObjectName("hostEdit")
        self.treeView = QtWidgets.QTreeView(self.centralwidget)
        self.treeView.setGeometry(QtCore.QRect(10, 60, 401, 281))
        self.treeView.setObjectName("treeView")
        self.treeView_2 = QtWidgets.QTreeView(self.centralwidget)
        self.treeView_2.setGeometry(QtCore.QRect(420, 60, 401, 281))
        self.treeView_2.setObjectName("treeView_2")
        self.listView = QtWidgets.QListView(self.centralwidget)
        self.listView.setGeometry(QtCore.QRect(10, 350, 401, 192))
        self.listView.setObjectName("listView")
        self.listView_2 = QtWidgets.QListView(self.centralwidget)
        self.listView_2.setEnabled(True)
        self.listView_2.setGeometry(QtCore.QRect(420, 350, 401, 192))
        self.listView_2.setObjectName("listView_2")
        self.uploadButton = QtWidgets.QPushButton(self.centralwidget)
        self.uploadButton.setGeometry(QtCore.QRect(10, 550, 401, 41))
        self.uploadButton.setObjectName("uploadButton")
        self.downloadButton = QtWidgets.QPushButton(self.centralwidget)
        self.downloadButton.setGeometry(QtCore.QRect(420, 550, 401, 41))
        self.downloadButton.setObjectName("downloadButton")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 852, 21))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "My FTP Client"))
        self.connectButton.setText(_translate("MainWindow", "Quickconnect"))
        self.usernameEdit.setPlaceholderText(_translate("MainWindow", "Username"))
        self.passEdit.setPlaceholderText(_translate("MainWindow", "Password"))
        self.portEdit.setPlaceholderText(_translate("MainWindow", "Port"))
        self.hostEdit.setPlaceholderText(_translate("MainWindow", "Host"))
        self.uploadButton.setText(_translate("MainWindow", "Upload"))
        self.downloadButton.setText(_translate("MainWindow", "Download"))

    if __name__ == "__main__":
        import sys
        app = QtWidgets.QApplication(sys.argv)
        MainWindow = QtWidgets.QMainWindow()
        ui = Ui_MainWindow()
        ui.setupUi(MainWindow)
        MainWindow.show()
        sys.exit(app.exec_())

A:

How do you want the QTreeView to show something if it does not tell you what to show?, a QTreeView what it does is show the content of some model, in your case you should use a QFileSystemModel.
from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    ...

class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setupUi(self)
        model = QtWidgets.QFileSystemModel(self)
        model.setRootPath(QtCore.QDir.rootPath())
        self.treeView.setModel(model)
        self.treeView.expandAll()
        self.treeView.setRootIndex(model.index(QtCore.QDir.rootPath()))

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    w = MainWindow()
    w.show()
    sys.exit(app.exec_())

