-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
1.1.0
-
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_())
######################################