Hi!
I've problem when making directory with QFileSystemModel. I've make new directory button connected to method similar to this:
def makeDirectory(self):
index = self.fileModel.setRootPath( self.dirPathLE.text() )
self.fileTV.setRootIndex(index)
newIndex = self.fileModel.mkdir(index, 'new_folder')
self.fileTV.setCurrentIndex(newIndex)
self.fileTV.edit(newIndex)
def makeDirectory(self):
index = self.fileModel.setRootPath( self.dirPathLE.text() )
self.fileTV.setRootIndex(index)
newIndex = self.fileModel.mkdir(index, 'new_folder')
self.fileTV.setCurrentIndex(newIndex)
self.fileTV.edit(newIndex)
To copy to clipboard, switch view to plain text mode
I want to allow user to input new directory name when creating directory. When I set setReadOnly(False) everything is working without problems, but then user can accidentaly rename any file in the list. How can I use setReadOnly(False) without allowing to rename file when pressing key ?
Thanks,
Marcin
Bookmarks