[PyQt] dirmodel

Krzysztof k4chim at gmail.com
Fri Nov 7 23:00:04 GMT 2008


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

Regards,

Krzychu


More information about the PyQt mailing list