Hi Reg

I trying reproduce the problem here but this small example works fine.

"""
from PySide.QtCore import *
from PySide.QtGui import *

app = QApplication([])
dir_model = QDirModel()
filters = QDir.Files | QDir.AllDirs | QDir.Readable | QDir.NoDotAndDotDot
dir_model.setFilter(filters)
dir_model.setReadOnly(True)
dir_model.setNameFilters(["*.ogg", "*.flac", "*.mp3",  "*.m4a"])
fileView = QTreeView()
fileView.setModel(dir_model)
fileView.show()
app.exec_()
"""

What could happen in your case is a mess between PySide and PyQt,
verify if you are using only PySide objects.

BR

On Mon, Dec 28, 2009 at 10:17 AM, regomodo <[email protected]> wrote:
> Hi, in my PyQt4 app it uses a QTreeView which I then change it's model to
> QDirModel by using QTreeView.setModel.
>
> However, in the pyside docs I see that this function is missing
>
> http://www.pyside.org/docs/pyside/PySide/QtGui/QTreeView.html
>
> Is this function enabled as I get errors with this code snippet:
>
>        self.dir_model = QDirModel()
>        filters = QDir.Files | QDir.AllDirs | QDir.Readable |
> QDir.NoDotAndDotDot
>        self.dir_model.setFilter(filters)
>        self.dir_model.setReadOnly(True)
>        self.dir_model.setNameFilters(["*.ogg", "*.flac", "*.mp3",  "*.m4a"])
>        self.ui.fileView.setModel(self.dir_model)
>
> The error(from Eric ide):
>
> The debugged program raised the exception unhandled ArgumentError
> "Python argument types in QTreeView.setModel(QTreeView, QDirModel) did not
> match C++ signature: setModel(QTreeView {lvalue}, QAbstractItemModel*)"
>
> Regards
>
> Reg
> _______________________________________________
> PySide mailing list
> [email protected]
> http://lists.openbossa.org/listinfo/pyside
>



-- 
Renato Araujo Oliveira Filho
Instituto Nokia de Tecnologia - INdT
Mobile: +55 (81) 8704-2144
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to