qt5base-lts/tests/auto/corelib/itemmodels
Giuseppe D'Angelo a0bcad3903 QAbstractProxyModel: delay headerDataChanged emissions when inserting/removing rows/columns
33c88f86b5 added some logic to QAPM in
order to have it automatically emit headerDataChanged when rows/columns
were added or removed in the model. This was done as a stopgap measure
to prevent QAPM from asking for illegal indices in order to implement
automatic remapping of the section headings (since there's no
mapSectionToSource).

The commit seems to have introduced a regression in QHeaderView, which
isn't prepared to receive headerDataChanged while a row/column count
change is in progress. When receiving headerDataChanged, QHeaderView
will try to read the row/column count and will store it internally.
When it will then receive the signals for insertion/removal of
rows/columns, it will interpret it as a modification of the previously
stored value -- even if the value it stored was already correct.

Fix this by avoiding to have two signals in flight at the same time;
emit headerDataChanged as a queued invocation.

Task-number: QTBUG-114225
Change-Id: I521465a852b8c7135f22f730ead41dca760ba428
Pick-to: 6.5 6.6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-23 16:24:27 +02:00
..
qabstractitemmodel QAbstractItemModel: fix match() with Qt::MatchWildcard 2023-03-09 18:26:59 +01:00
qabstractproxymodel QAbstractProxyModel: delay headerDataChanged emissions when inserting/removing rows/columns 2023-06-23 16:24:27 +02:00
qconcatenatetablesproxymodel tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qidentityproxymodel tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qitemmodel tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qitemselectionmodel tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qsortfilterproxymodel Remove unused variables 2023-04-19 12:55:02 +02:00
qsortfilterproxymodel_recursive tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qsortfilterproxymodel_regularexpression Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qstringlistmodel tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qtransposeproxymodel tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00