summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2023-02-13 21:59:45 +0000
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-02-15 15:12:12 +0100
commitec8e6ed20034a5ea7d32bdc62b3b9dc91ce68d36 (patch)
tree5bedcae00a8abfe93f1ea617115d3a1e41f1f9bd
parent5d13e05651af04d471f110c782cbce85f54d1cb7 (diff)
Fix connections in QWidgetWindow
A recent update moved handleScreenChange out of being a private slot. Porting to the new syntax fixes the warning and moves to a compile-time check. Pick-to: 6.5 Change-Id: Ibd85c6caf7dca051d669250a94a82fbddbd3435d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index b6a6acfc92..7756893369 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -129,7 +129,7 @@ QWidgetWindow::QWidgetWindow(QWidget *widget)
}
connect(widget, &QObject::objectNameChanged, this, &QWidgetWindow::updateObjectName);
- connect(this, SIGNAL(screenChanged(QScreen*)), this, SLOT(handleScreenChange()));
+ connect(this, &QWidgetWindow::screenChanged, this, &QWidgetWindow::handleScreenChange);
}
QWidgetWindow::~QWidgetWindow()
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index 3211edbb33..addcc7d321 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -53,6 +53,7 @@ public:
tst_QWidget_window();
public slots:
+ void init();
void initTestCase();
void cleanupTestCase();
void cleanup();
@@ -129,6 +130,11 @@ void tst_QWidget_window::initTestCase()
{
}
+void tst_QWidget_window::init()
+{
+ QTest::failOnWarning(QRegularExpression(".*No such slot.*"));
+}
+
void tst_QWidget_window::cleanupTestCase()
{
}