Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-105

QtGui.QFileSystemModel.setRootPath() get parameters TypeError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • None
    • 1.1.0
    • PySide
    • None
    • win7 32bit
      python 3.2.2 32bit

      In PySide 1.1.0 documentation says:
      PySide.QtGui.QFileSystemModel.setRootPath(path)
      Parameters:path – unicode
      Return type:PySide.QtCore.QModelIndex

      but the python interpreter says:
      TypeError: descriptor 'setRootPath' requires a 'PySide.QtGui.QFileSystemModel' object but received a 'str'

      Here is my code:
      ##################################
      #coding: utf-8
      from PySide import QtCore, QtGui
      import sys
      app = QtGui.QApplication(sys.argv)

      model = QtGui.QFileSystemModel
      model.setRootPath(QtCore.QDir.currentPath())

      tree = QtGui.QTreeView()
      tree.setModel(model)
      tree.setRootIndex(model.index(QtCore.QDir.currentPath()))

      tree.show()
      sys.exit(app.exec_())
      ######################################

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            setanta Marcelo Lira
            jirauser34481 user-5d9cf (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes