Fix assert in ~QPersistentModelIndex

Review Request #113917 - Created Nov. 18, 2013 and submitted

Information
Kevin Funk
kate
236948
Reviewers
kate
mwolff
Fix assert in ~QPersistentModelIndex

KateCompletionWidget may call QAIM::setCurrentIndex during a reset of
the model, inside KateCompletionWidget::modelContentChanged(). At this
point, model indices are invalid, but QAIM wasn't informed about it.

The main problem is that KateCompletionModel doesn't use the
(relatively) new {begin,end}ResetModel blocks to make persistent model
indices
invalid as soon as we start resetting the model. Instead reset() is used
*after* we have reset the model. However, KateCompletionModel may emit
contentGeometryChanged too early (before a reset()) and hence triggering
QAIM::setCurrentIndex while QAIM is still referencing now invalid
persistent model indices.

Other changes:
Remove contentGeometryChanged. Instead, use layoutChanged() and
modelReset() signals to react to model changes.

This also ports KateCompletionModel away from deprecated QAIM methods
such as QAIM::reset()

BUG: 236948
FIXED-IN: 4.13

  

Issues

  • 2
  • 3
  • 0
  • 5
Description From Last Updated
if this is called from within setCurrentCompletion, you'll nest the reset signals - is this supported by Qt? i.e.: beginResetModel(); ... Milian Wolff Milian Wolff
this is now called in a begin/endResetModel block, which obsoletes these calls. Generally, this might explain also the speed slowdown, ... Milian Wolff Milian Wolff
Kevin Funk
Milian Wolff
Milian Wolff
Dominik Haumann
Kevin Funk
Christoph Cullmann
Milian Wolff
Kevin Funk
Christoph Cullmann
Milian Wolff
Commit Hook
Commit Hook
This review has been submitted with commit a0a1b3ced5bdfe6c43a323ab7b700c20f1f4b93c by Michal Humpula on behalf of Kevin Funk to branch frameworks.
Kevin Funk
Review request changed

Status: Closed (submitted)

Loading...