my solution is outside of QFileSystemModel. use
QDir.removeRecursively()
def del_folder(self, checked, index):
if not index.isValid():
return
model = index.model()
path = model.fileInfo(index).absoluteFilePath()
dir1 = QtCore.QDir(path)
dir1.removeRecursively() # remove all.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…