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>
This commit is contained in:
David Edmundson 2023-02-13 21:59:45 +00:00 committed by Volker Hilsheimer
parent 5d13e05651
commit ec8e6ed200
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(this, SIGNAL(screenChanged(QScreen*)), this, SLOT(handleScreenChange()));
connect(this, &QWidgetWindow::screenChanged, this, &QWidgetWindow::handleScreenChange);
}
QWidgetWindow::~QWidgetWindow()

View File

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