title: Python: PyQt QTreeview example - selection
body: <p>I'm using Python 2.7 and Qt designer and I'm new to MVC:
  I have a View completed within Qt to give me a directory tree list, and the controller in place to run things. My question is:</p>
  
  <p><strong>Given a Qtree view, how may I obtain a directory once a dir is selected?</strong></p>
  
  <p><img src="https://i.stack.imgur.com/xOd5h.png" alt="enter image description here"></p>
  
  <p>Code snap shot is below, I suspect it's SIGNAL(..) though I'm unsure:</p>
  
  <pre><code>class Main(QtGui.QMainWindow):
    plot = pyqtSignal()
  
    def __init__(self):
      QtGui.QMainWindow.__init__(self)
      self.ui = Ui_MainWindow()
      self.ui.setupUi(self)
  
      # create model
      model = QtGui.QFileSystemModel()
      model.setRootPath( QtCore.QDir.currentPath() )
  
      # set the model
      self.ui.treeView.setModel(model)
  
      **QtCore.QObject.connect(self.ui.treeView, QtCore.SIGNAL('clicked()'), self.test)**
  
    def test(self):
      print "hello!"
  </code></pre>