summaryrefslogtreecommitdiff
path: root/src/qmlcompiler/qqmljsfunctioninitializer.cpp
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2022-09-21 13:44:19 +0200
committerJan Arve Sæther <jan-arve.saether@qt.io>2022-10-07 12:32:00 +0200
commitc41075d9e2808f636d793c93e237f80a8ecadb2e (patch)
tree05c419c97ba16a2087d156b1a53ca293af8a1110 /src/qmlcompiler/qqmljsfunctioninitializer.cpp
parentb25555426eb0255f5831f6d4c482c9710c5b46a3 (diff)
downloadqtdeclarative-c41075d9e2808f636d793c93e237f80a8ecadb2e.tar.gz
Fix wrong item-sizeHint-cache when StackLayout children were reordered
This fixes the Tests_StackLayout::test_addAndRemoveItems() autotest The code uses an index to look up the cached size hints. This index corresponds to the layout's item child index (which doesn't have to correspond to the children index). The vector of sizeHints then had to be in sync with the index of the child layout items for this to work. The problem here was that if the first item in the stack was removed (or siblings was reordered), the vector was not adjusted for this (basically we could get the size hint of an previously removed item). In order to avoid to keep the QVector<SizeHints> index in sync with the layout children index, we change it to use a QHash instead, where we look up by QQuickItem*. QHash<QQuickItem*, SizeHints> Task-number: QTBUG-106520 Task-number: QTBUG-106521 Pick-to: 6.4 6.2 5.15 Change-Id: I7c1f9fb018fcab093b074c45dfaba264f76749f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
0 files changed, 0 insertions, 0 deletions