On Sat, 8 Nov 2008 00:00:04 +0100, Krzysztof <[EMAIL PROTECTED]> wrote:
> hi,
> how can I list all files and dirs including  ".." except "."
> 
> I do this
> 
> class QDirModelEx(PyQt4.QtGui.QDirModel):
>     def __init__(self, parent = None):
>         PyQt4.QtGui.QDirModel.__init__(self, parent)
>     def data(self, index, role = PyQt4.QtCore.Qt.DisplayRole):
>         data = PyQt4.QtGui.QDirModel.data(self, index, role)
>         if(data.toString().__eq__(".")):
>             return PyQt4.QtCore.QVariant()
>         return data
> 
> but it only set display name to "", how van I remove this item
> thanks in advance

Use QDirModel.setFilter(QDir.NoDotAndDotDot)

Phil
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to