I have a QTreeView populated with some QStandardItems. The items are editable, and I want to program to react whenever the text of an item is changed, either by way of a signal or an event filter. I can’t find anything that fills the bill. I tried QStandardModel::itemChanged, but that responds to changes in other item data, and I don’t see a way to distinguish between changes in the text content and user data. What is the best way to approach this?
I have a QTreeView populated with some QStandardItem s. The items are editable, and
Share
To deal with this I wound up deriving a class from QStandardItem and overriding QStandardItem::setData something like this: