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() { }