QtTest: code tidies: use the 4-arg connect overload

The 3-arg connect is error-prone and makes the lifetime of the
connection unclear.

Change-Id: I51f9bd87caa9baa57d06c8f3fd9ed8b37ef49cae
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2023-06-24 12:36:50 +02:00
parent 844009f8e0
commit c87cbc38f1

View File

@ -150,8 +150,8 @@ private:
static void updateHandler(QAccessibleEvent *event)
{
auto ev = copyEvent(event);
if (ev->object()) {
QObject::connect(ev->object(), &QObject::destroyed, [&, ev](){
if (auto obj = ev->object()) {
QObject::connect(obj, &QObject::destroyed, obj, [&, ev](){
auto index= eventList().indexOf(ev);
if (index == -1)
return;