ListModel: Avoid crashes after items were removed


It is possible to remove items from the model while still keeping a
reference to them (obtained via get). Modifying properties of that
object would have crashed so far, due to the internal pointer being
null (as the actual model entry is gone).
Fix that by adding checks for the item being gone in virtualPut and
virtualGet.

Amends 90c55e859ea2

Fixes: QTBUG-151518
Initial-patch-by: Gašper Lah
Pick-to: 6.12 6.8
Change-Id: I9e0a196cc6aee2ea0efe6511a7962ef3f6e9f748
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
commit0a47c2821cde7c09ae2922202b67fae67403fc4b
parent54abd771763cfaa878ec859168477d79395e3c21
authorFabian Kosmale <fabian.kosmale@qt.io>
committerFabian Kosmale <fabian.kosmale@qt.io>
commit timeTue, 20 Oct 2026 17:56:09 +0000