Home > Mobile >  QFileSystemModle how to implement in the QTreeView F2 to change the file name?
QFileSystemModle how to implement in the QTreeView F2 to change the file name?

Time:11-05

The diagram below, to achieve a Windows explorer on the F2 renamed the kind of function,
Please tall person to give directions,


CodePudding user response:

QTreeView has a key binding, is the shortcut key, F2 will enter a state of editor, create a new QTreeView class inheritance and overloading dataChanged when F2, into editable state (similar to use mouse click, edit), when the complete value modifying, will trigger dataChanged, functions, implementation in the dataChanged want

CodePudding user response:

Hzh_Beyond thanks, probably can know what you mean
Difficult in QTreeView key bindings is how to achieve this?
The UI - & gt; TreeView - & gt; SetEditTriggers (QAbstractItemView: EditKeyPressed);
After setting, press F2 still no any response, I don't know why,
  •  Tags:  
  • Qt
  • Related