Bug 5975: Rapid number entry on SCT can cause model crash Bug Number: 5975 Release notes (y/n): No, not yet. For Release Nums: 7.1 This was a very difficult bug to diagnose, as the crash was in different places in the debug and release builds. It turns out to be some sort of race condition involving KEY PRESS EVENTS in the QTableView subclass (SctTableView) and the life cycle of the INCELL EDITOR managed by the QAbstractItemDelegate subclass (SctTableDelegate). In the SctTableView::keyPressEvent (QKeyEvent*) method, a query to the SctTableDelegate to determine whether or not an incell edit is in progress IS SOMETIMES MISTAKEN when the editor is being deleted. That query is based on the incell editor widget being instantiated. I modified the processing of that method to do a SECOND check by calling the base class keyPressEvent method, and noticing whether or not the QKeyEvent instance comes back in the "accepted" (consumed) state. In that case, we regard the edit as still, effectively, being in progress. That method, and the rewrite, is a little complicated because of the need to support "I" and "O" keys as special operations -- setting a flag and moving to the next timestep. We need to avoid those characters going into an active incell edit. There is also a workaround in there to avoid what seems to be a very strange feature of jumping to a particular cell based on entry of a digit if no cell is selected. The current code is in two commits. This needs to be squashed and reviewed, removing certain unnecessary diagnostic code.