Search code examples
pythonqtmodelpyqtqmodelindex

How to revert a persistent Delegate ModelIndex back to "normal"


Once a delegate item has been set as persistent using:

tableView.openPersistentEditor(model.index(0, 0))

would it be possible to revert it back to "unpersistent" (irresolute)?


Solution

  • You can use closePersistentEditor to close the persistent editor at a given index :

    tableView.closePersistentEditor(model.index(0, 0))