We've gotten backtraces that indicate crashes in this method, and all that I can
see could be wrong is an invalid model() pointer. Can't really explain that for now,
but let's introduce a check just to make sure.
if(event->type() != QEvent::User)
return;
if(event->type() != QEvent::User)
return;
+ if(!model())
+ return;
+
QModelIndex topLevelIdx;
for(int i = 0; i < model()->rowCount(rootIndex()); i++) {
topLevelIdx = model()->index(i, 0, rootIndex());
QModelIndex topLevelIdx;
for(int i = 0; i < model()->rowCount(rootIndex()); i++) {
topLevelIdx = model()->index(i, 0, rootIndex());