title: PyQt5 Filebrowser Signal-Slot: connecting QTreeView to QColumnview
body: <p>I want to create a little Filebrowser as described here, but by using PyQt5: <a href="http://www.youtube.com/watch?v=92biLZST6Vg" rel="nofollow">Youtube-Video-Description</a></p>
  
  <p>So far the Layout is working fine. Now I would like to implement the function that the files show up on the left QColumnView. Meaning the files of the clicked folder in the QTreeView can be seen on the right File-QColumnView. I don't get the point of how to create the right signal to set the pathindex for the QFileSystemModel of the QColumnView. Besides, it would be nicer if i could only show one (the name) column of the Folder-QTreeView.
  Here is the code for the Browser:</p>
  
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  from PyQt5.QtWidgets import QTreeView, QFileSystemModel, QApplication, QColumnView, QDockWidget, QMainWindow, QTextEdit
  from PyQt5.QtCore import QDir, Qt
  
  rootpath = QDir.currentPath()
  
  class Browser(QMainWindow):
      def __init__(self):
          super(Browser, self).__init__()
          self.createDockWindows()
          self.textEdit = QTextEdit()
          self.setCentralWidget(self.textEdit)
      def createDockWindows(self):
          dock = QDockWidget("Folders", self)
          dock.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
          #Code to Create FileView Colums and FolderTree
          self.FileView = QtWidgets.QColumnView()
          self.FileView.setGeometry(QtCore.QRect(240, 10, 291, 281))
          self.FolderTree = QtWidgets.QTreeView()
          self.FolderTree.setGeometry(QtCore.QRect(10, 10, 221, 281))
          FolderTree = self.FolderTree
          #FolderTree.hidecolumn(1),... ?? to show only name column
  
          #include FolderTree to a Dock at the left side
          dock.setWidget(FolderTree)
          self.addDockWidget(Qt.LeftDockWidgetArea, dock)
          #set the model and rootpath for filling the FolderTree from self.ui
          dirmodel = QFileSystemModel()
          #set filter to show only folders
          dirmodel.setFilter(QDir.NoDotAndDotDot | QDir.AllDirs)
          dirmodel.setRootPath(rootpath)
          #filemodel and filter for only files on right side
          filemodel = QFileSystemModel()
          filemodel.setFilter(QDir.NoDotAndDotDot | QDir.Files)
          filemodel.setRootPath(rootpath)
          FolderView = self.FolderTree
          FolderView.setModel(dirmodel)
          FolderView.setRootIndex(dirmodel.index(rootpath))
          FileView = self.FileView
          FileView.setModel(filemodel)
          dock = QDockWidget("Files", self)
          dock.setWidget(FileView)
          self.addDockWidget(Qt.RightDockWidgetArea, dock)
  
          #important lines for the connection, which does not work    
          self.FolderTree.clicked['QModelIndex'].connect(self.setpathonclick)
      def setpathonclick(self):
          currentpathindex = self.FolderTree.currentIndex()
          self.FileView.setCurrentIndex(currentpathindex)
  
  if __name__ == '__main__':
      import sys
      app = QApplication(sys.argv)
      w = Browser()
      w.resize(640, 480)
      w.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>The last 12 lines are the important lines for the onclick connection of FolderTree and FileOverView. </p>