Hi!

I've problem when making directory with QFileSystemModel. I've make new directory button connected to method similar to this:

Qt Code:
  1. def makeDirectory(self):
  2.  
  3. index = self.fileModel.setRootPath( self.dirPathLE.text() )
  4. self.fileTV.setRootIndex(index)
  5.  
  6. newIndex = self.fileModel.mkdir(index, 'new_folder')
  7. self.fileTV.setCurrentIndex(newIndex)
  8. 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