Don't call virtual methods after the source model is destroyed.
authorAndreas Hartmetz <andreas.hartmetz@kdab.com>
Thu, 28 Aug 2014 18:23:11 +0000 (20:23 +0200)
committerAndreas Hartmetz <ahartmetz@gmail.com>
Wed, 3 Sep 2014 19:35:08 +0000 (21:35 +0200)
commit8e720177ef18d471c8ffa455750fdcd375d7a8da
tree203eacfc2a01d9d7eb2d87476cee7a60824fab30
parent997d626173d9aba5b01b35e4d95ad162771ba789
Don't call virtual methods after the source model is destroyed.

Calling clear_mapping causes the persistent indexes to be queried, and
mapped using map_to_source, so that they can be restored later. That
is not the appropriate response to the source model being deleted
because there won't be anything to restore.

Simply clear the stored mapping information instead so that the source model
actually exists when mapToSource is called by the framework.

Backport of 722798a359761a1eb635d18547b076615f192508 from qt5/qtbase

Change-Id: I9c74f97855046b968dfba7a35134c234b974e63b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/gui/itemviews/qabstractproxymodel.cpp
src/gui/itemviews/qsortfilterproxymodel.cpp
tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp