diff options
author | Ivan Tkachenko <me@ratijas.tk> | 2023-06-16 16:35:02 +0300 |
---|---|---|
committer | Ivan Tkachenko <me@ratijas.tk> | 2023-06-19 18:37:59 +0300 |
commit | e50b2069f90542328fbc9917bf0345f30dfa583e (patch) | |
tree | 57d003363c764ed88fb43c5a638182109e959d54 /src/quick/items/qquickwindow.cpp | |
parent | b8bd5466eb82e515aef01316f3c8a96623fd9419 (diff) |
QQuickWindow: Port SIGNAL/SLOT macro based connections to pointer-to-member
Enables code navigation with LSP, and overall makes code more robust.
Change-Id: Ic8541aa38f2b0194b141c55e90e73bc9879e0867
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 6b20fb2bb2..08648ee4f6 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -81,8 +81,8 @@ public: QAnimationDriver *animationDriver = m_renderLoop->animationDriver(); if (animationDriver) { - connect(animationDriver, SIGNAL(stopped()), this, SLOT(animationStopped())); - connect(m_renderLoop, SIGNAL(timeToIncubate()), this, SLOT(incubate())); + connect(animationDriver, &QAnimationDriver::stopped, this, &QQuickWindowIncubationController::animationStopped); + connect(m_renderLoop, &QSGRenderLoop::timeToIncubate, this, &QQuickWindowIncubationController::incubate); } } @@ -761,15 +761,14 @@ void QQuickWindowPrivate::init(QQuickWindow *c, QQuickRenderControl *control) animationController.reset(new QQuickAnimatorController(q)); - QObject::connect(context, SIGNAL(initialized()), q, SIGNAL(sceneGraphInitialized()), Qt::DirectConnection); - QObject::connect(context, SIGNAL(invalidated()), q, SIGNAL(sceneGraphInvalidated()), Qt::DirectConnection); - QObject::connect(context, SIGNAL(invalidated()), q, SLOT(cleanupSceneGraph()), Qt::DirectConnection); + QObject::connect(context, &QSGRenderContext::initialized, q, &QQuickWindow::sceneGraphInitialized, Qt::DirectConnection); + QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::sceneGraphInvalidated, Qt::DirectConnection); + QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::cleanupSceneGraph, Qt::DirectConnection); - QObject::connect(q, SIGNAL(focusObjectChanged(QObject*)), q, SIGNAL(activeFocusItemChanged())); - QObject::connect(q, SIGNAL(screenChanged(QScreen*)), q, SLOT(handleScreenChanged(QScreen*))); - QObject::connect(qApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)), - q, SLOT(handleApplicationStateChanged(Qt::ApplicationState))); - QObject::connect(q, SIGNAL(frameSwapped()), q, SLOT(runJobsAfterSwap()), Qt::DirectConnection); + QObject::connect(q, &QQuickWindow::focusObjectChanged, q, &QQuickWindow::activeFocusItemChanged); + QObject::connect(q, &QQuickWindow::screenChanged, q, &QQuickWindow::handleScreenChanged); + QObject::connect(qApp, &QGuiApplication::applicationStateChanged, q, &QQuickWindow::handleApplicationStateChanged); + QObject::connect(q, &QQuickWindow::frameSwapped, q, &QQuickWindow::runJobsAfterSwap, Qt::DirectConnection); if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>()) service->addWindow(q); |