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.

Change-Id: Ibd85c6caf7dca051d669250a94a82fbddbd3435d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ec8e6ed20034a5ea7d32bdc62b3b9dc91ce68d36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
David Edmundson 2023-02-13 21:59:45 +00:00 committed by Qt Cherry-pick Bot
parent c22cf6dc07
commit 390ce392c8
2 changed files with 7 additions and 1 deletions

View File

@ -129,7 +129,7 @@ QWidgetWindow::QWidgetWindow(QWidget *widget)
} }
connect(widget, &QObject::objectNameChanged, this, &QWidgetWindow::updateObjectName); connect(widget, &QObject::objectNameChanged, this, &QWidgetWindow::updateObjectName);
connect(this, SIGNAL(screenChanged(QScreen*)), this, SLOT(handleScreenChange())); connect(this, &QWidgetWindow::screenChanged, this, &QWidgetWindow::handleScreenChange);
} }
QWidgetWindow::~QWidgetWindow() QWidgetWindow::~QWidgetWindow()

View File

@ -53,6 +53,7 @@ public:
tst_QWidget_window(); tst_QWidget_window();
public slots: public slots:
void init();
void initTestCase(); void initTestCase();
void cleanupTestCase(); void cleanupTestCase();
void cleanup(); 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() void tst_QWidget_window::cleanupTestCase()
{ {
} }