Gnats 5095: Qt assertion failure loading model when starting in Geospatial View
Phil Weinstein, 9-12-2011, Resolved / See Gnats entry.

INITIAL ANALYSIS -- see resolution

This bug doesn't seem to manifest with trivial or small models. This sequence pretty reliably produces a crash:

  1. Start RiverWare
  2. Switch to the Geospatial View
  3. Load regression test: Sim/crssTest.mdl.gz
  4. ... Qt ASSERTION FAILURE in method QGraphicsScenePrivate::_q_processDirtyItems().

This is a low-level assertion failure in Qt.  Purify doesn't show any memory errors (though it does fail the assertion, but continues to run correctly).

The following September 2010 patch to Qt 4.7 (which I found with Google with "assert calledEmitUpdated") seems to be related, but it's not the whole story. The 4.6.3 code is sufficiently different that this particular fix may not be exaclty what's needed -- but the fact that this is a buggy area in Qt may be relevant. For one thing, the failing assertion in 4.6.3 (i.e. not the Qt version for which the patch is intended) is tested only when an 'updateAll' flag is 'true'. And this patch corrects a bug of incorrectly setting that flag to 'false' (when it needed to stay 'true'). So, that alone wouldn't explain why this patch would avoid the assertion failure. (Note that the number of places in Qt code referring to these two flags is small). It's very possible that Qt 4.6.4 and 4.7 have fixed the problem we are seeing -- that seems likely from the Qt 4.6.3 code I'm seeing here.

Assertion calledEmitUpdated fails in QGraphicsScene. Problem was that the 'updateAll' boolean was reset to 'false' when it really should have been unchanged. This happened when rendering the scene from outside the view's paint event (i.e. from QGraphicsView/ Scene::render). We only want to reset 'updateAll' when triggering drawItems() from QGraphicsView::paintEvent, i.e. when the 'view' pointer != 0.

Broke after commit: dda8a57c.
Task-number: QT-3674

Other notes:

---