示例#1
0
 def data(self, index, role=Qt.DisplayRole):
     if (role == Qt.DisplayRole and index.column() == 0):
         path = QDir.toNativeSeparators(self.filePath(index))
         if path.endsWith(QDir.separator()):
             path.chop(1)
         return path
     return QDirModel.data(self, index, role)
示例#2
0
 def data(self, index, role=Qt.DisplayRole):
     if role != Qt.CheckStateRole:
         return QDirModel.data(self, index, role)
     else:
         if index.column() == 0:
             return self.checkState(index)