MCPcopy Create free account
hub / github.com/PyQt5/PyQt / onItemDataChanged

Method onItemDataChanged

QTreeView/Lib/qmodelmapper.py:223–239  ·  view source on GitHub ↗
(
        self, topLeft: QModelIndex, bottomRight: QModelIndex, roles: List[int]
    )

Source from the content-addressed store, hash-verified

221 return
222
223 def onItemDataChanged(
224 self, topLeft: QModelIndex, bottomRight: QModelIndex, roles: List[int]
225 ):
226 item = self._model.itemFromIndex(topLeft)
227 if not item or Qt.EditRole not in roles or item.valueItem:
228 return
229
230 path = getattr(item, "path", None)
231 if not path:
232 return
233
234 # 更新关联的widget
235 value = item.edit
236 for widget in self._keywidget.get(path, []):
237 if self.Debug:
238 print(f"model to view({widget}) = {value}")
239 self._setValue(widget, path, value, updated=True, block=True)

Callers

nothing calls this directly

Calls 1

_setValueMethod · 0.95

Tested by

no test coverage detected