Go to file
Giuseppe D'Angelo 453f469216 QAbstractItemView: do not access invalid model indices (3/N)
The slots connected to rowsAboutToBeRemoved and columnsAboutToBeRemoved
attempt to find a new current index by scanning the model around the
existing current index -- in case that index is indeed about to be
removed.

The problem is that the scanning was done without any sorts of bounds
checking; instead it was relying on the model's index() to return an
invalid index for an out of bounds request.

Fix that by adding bounds checking. Since models are not supposed
to return invalid indices for in-bounds index() calls, added some
warnings if that happens.

For some reason, the code handling rows and columns isn't perfectly
symmetrical. Rows are searched both forwards and backwards, while
columns only backwards, and the related code is slightly different.
Filed QTBUG-100273 to try and understand what's going on.

Change-Id: I7452d8c521e74daa4408e6cc969ce5a6059f53ea
Pick-to: 5.15 6.2 6.3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-02-02 15:09:22 +01:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin Provide a qtpaths wrapper script when cross-building Qt 2021-11-08 13:41:03 +01:00
cmake Use builtin test data on Integrity 2022-02-02 09:18:25 +01:00
coin Coin: use CMAKE_STAGING_PREFIX for cross-compilations 2022-01-20 10:07:04 +02:00
config.tests qsimd_p.h: add a hack to allow AVX to work with MinGW 2022-01-20 20:48:23 -03:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Doc: State Qt versions for when CMake commands etc. were introduced 2022-02-01 16:51:01 +01:00
examples Doc: Update Notepad tutorial 2022-01-31 14:24:11 +01:00
lib
libexec Fix various configure time warnings about missing QT_BEGIN_NAMESPACE 2021-11-01 17:17:29 +02:00
mkspecs INTEGRITY: Prevent deletion of virtual functions 2022-01-25 14:02:59 +02:00
qmake QMake: replace a Q_ASSERT() with a Q_UNREACHABLE() 2022-01-25 03:48:46 +01:00
src QAbstractItemView: do not access invalid model indices (3/N) 2022-02-02 15:09:22 +01:00
tests Fix flags in QFileSystemModel 2022-02-02 10:28:13 +01:00
util Bump version to 6.4.0 2022-01-31 17:20:06 +02:00
.cmake.conf Bump version to 6.4.0 2022-01-31 17:20:06 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag
CMakeLists.txt Use REALPATH based check for symbolic links on Windows 2022-01-07 14:31:38 +01:00
conanfile.py Conan: use settings.build_type if not set by Qt options for the build 2022-01-21 13:49:35 +02:00
config_help.txt Document that schannel is on by default 2021-10-06 15:05:20 +02:00
configure Remove unsupported, host-related options from configure shell script 2021-08-05 02:44:27 +02:00
configure.bat Fix our usage of CMake script mode in Windows configure 2021-08-20 19:44:43 +02:00
configure.cmake configure: Tie -appstore-compliant to QT_APPLE_NO_PRIVATE_APIS 2022-02-02 05:25:06 +01:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
LICENSE.FDL Remove trailing whitespace in LICENSE.FDL 2021-11-26 18:28:49 +01:00
LICENSE.GPL2
LICENSE.GPL3
LICENSE.GPL3-EXCEPT
LICENSE.LGPL3
LICENSE.QT-LICENSE-AGREEMENT Update latest qt license agreement 2021-12-02 14:16:49 +00:00
qt_cmdline.cmake CMake: Add support building Qt with the 'mold' linker 2022-01-20 19:01:27 +01:00
sync.profile Implement generating of a module cpp export header 2021-06-24 20:40:49 +02:00