summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/globals.h
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-09-23 16:40:50 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-10-28 07:11:49 +0000
commitf64011e117e759754f7b4f2885f9bf335a6596ff (patch)
treef811214fcdbe6f5b666c92c7195a1c06fbffead8 /src/libs/installer/globals.h
parent270c5dfd9b6c86bec8eaf34d0a2c3d3b945ed5e5 (diff)
ComponentModel: Fix segfaults on reset when used with a proxy model
Resetting the model is split into two parts - 'ComponentModel ::setRootComponents' updates the root item list and emits 'QAbstractItemModel::modelReset' which was connected to a private slot of the class that updates the component check state and then emits 'QAbstractItemModel::dataChanged' for each component index. The issue was that these could be emitted before the proxy model's private slot that catches the source model reset and performs invalidation had been invoked, causing the proxy model's slot reacting to source model data changes to refer previously retrieved source model indexes, which now had invalid information. Fix by moving the post-reset operations to non-slot function 'ComponentModel::postModelReset()' which is called after the 'QAbstractItemModel::modelReset' is emitted, so that any directly connected slots get invoked first. Task-number: QTIFW-1404 Change-Id: If4d55110c93658689787484d0e8a8eb6b6da685d Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/globals.h')
0 files changed, 0 insertions, 0 deletions