qt5base-lts/tests/auto
Axel Spoerl 4f4a8e75ab QItemSelectionModelPrivate: use QObjectPrivate::connect
QItemSelectionModelPrivate::initModel() uses string based connections,
to connect/disconnet its QAbstractItemModel.
The QObject::destroyed signal is connected to modelDestroyed(), which
does not disconnect other signals.

QQuickTableView's selection model binds to its QAbstractItemModel.
The binding also reacts to QObject::destroyed
Eventually, QItemSelectionModel::setModel(nullptr) is called.
At this point, only a QOBject is left from the QAbstractItemModel.
That leads to warnings about disconnecting string based signals, which
belong to QAbstractItemModel.

This patch changes the connect syntax to the QObjectPrivate::connect
API. Instead of keeping a list of string based connections around, the
connections themselves are kept in a list member. Disconnecting happens
based on that list.
Connections are also disconnected in
QAbstractItemModelPrivate::modelDestroyed.

An auto test is added in tst_QItemSelectionModel.

Fixes: QTBUG-116056
Pick-to: 6.6 6.5 6.2
Change-Id: I57e5c0f0a574f154eb312a282003774dd0613dd6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-09-01 00:11:51 +02:00
..
bic/data Add binary compatibility file built against 6.5.0 2023-04-19 15:40:36 +00:00
cmake CMake: Fix find_package(Qt6*Tools) in non-qtbase tests 2023-08-23 16:21:58 +02:00
concurrent tst_QtConcurrentMedian: compile with QT_NO_FOREACH 2023-08-19 16:28:20 +03:00
corelib QItemSelectionModelPrivate: use QObjectPrivate::connect 2023-09-01 00:11:51 +02:00
dbus tests/auto/: port Q_FOREACH to ranged-for, local const containers 2023-08-19 16:29:25 +03:00
gui tests/auto/*: port Q_FOREACH to ranged-for, make container const 2023-08-19 16:29:30 +03:00
guiapplauncher Move Weather Anchor Layout example to manual tests 2023-03-02 05:55:57 +01:00
network tst_QSslSocket: don't use deprecated RSA api 2023-08-29 20:15:05 +02:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other Disable android_deployment_settings test for non-standalone scenario 2023-08-25 18:37:23 +02:00
printsupport Fix tst_qprinterinfo.cpp not compiling on Vxworks 2023-08-24 08:04:01 +00:00
shared tests: remove PlatformInputContext::filterEvent() 2023-01-18 13:21:06 +01:00
sql tst_qvfssql: Don't use appless main 2023-08-11 15:45:36 +02:00
testlib tst_selftests: add a way to run a subset of all subprograms 2023-08-31 06:26:25 +00:00
tools tst_qmakelib: compile with QT_NO_FOREACH 2023-08-19 19:17:17 +03:00
wasm CMake: Make qtbase tests standalone projects 2023-07-05 15:09:32 +02:00
widgets Enable QWidget::grab() with QRhiWidget in the widget tree 2023-08-28 21:14:28 +02:00
xml CMake: Make qtbase tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt CI: Enable tests under auto/wasm on Wasm platform 2023-08-28 14:10:02 +02:00
network-settings.h QtNetworkSettings: narrow down hasIPv6 to specific OSes 2023-08-29 07:20:51 -07:00