diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 18af2285e8..39910830e5 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -2334,7 +2334,7 @@ void AbstractClient::createDecoration(const QRect &oldGeometry) { KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this); if (decoration) { - QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection); + QMetaObject::invokeMethod(decoration, QOverload<>::of(&KDecoration2::Decoration::update), Qt::QueuedConnection); connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::updateShadow); connect(decoration, &KDecoration2::Decoration::bordersChanged, this, &AbstractClient::updateDecorationInputShape); diff --git a/src/decorations/decoratedclient.cpp b/src/decorations/decoratedclient.cpp index 7485e183c9..52552686c5 100644 --- a/src/decorations/decoratedclient.cpp +++ b/src/decorations/decoratedclient.cpp @@ -176,7 +176,7 @@ DELEGATE(requestMinimize, minimize) void DecoratedClientImpl::requestClose() { - QMetaObject::invokeMethod(m_client, "closeWindow", Qt::QueuedConnection); + QMetaObject::invokeMethod(m_client, &AbstractClient::closeWindow, Qt::QueuedConnection); } QColor DecoratedClientImpl::color(KDecoration2::ColorGroup group, KDecoration2::ColorRole role) const diff --git a/src/effectloader.h b/src/effectloader.h index 31b0be60a4..de80d9ffcb 100644 --- a/src/effectloader.h +++ b/src/effectloader.h @@ -254,7 +254,7 @@ private: return; } m_dequeueScheduled = true; - QMetaObject::invokeMethod(this, "dequeue", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, &AbstractEffectLoadQueue::dequeue, Qt::QueuedConnection); } Loader *m_effectLoader; bool m_dequeueScheduled; diff --git a/src/kcmkwin/kwindecoration/kcm.cpp b/src/kcmkwin/kwindecoration/kcm.cpp index 80e70bc4b3..854cca2f37 100644 --- a/src/kcmkwin/kwindecoration/kcm.cpp +++ b/src/kcmkwin/kwindecoration/kcm.cpp @@ -93,7 +93,7 @@ KCMKWinDecoration::KCMKWinDecoration(QObject *parent, const QVariantList &argume .connect(QString(), QStringLiteral("/KWin"), QStringLiteral("org.kde.KWin"), QStringLiteral("reloadConfig"), this, SLOT(reloadKWinSettings())); - QMetaObject::invokeMethod(m_themesModel, "init", Qt::QueuedConnection); + QMetaObject::invokeMethod(m_themesModel, &KDecoration2::Configuration::DecorationsModel::init, Qt::QueuedConnection); } KWinDecorationSettings *KCMKWinDecoration::settings() const @@ -103,7 +103,7 @@ KWinDecorationSettings *KCMKWinDecoration::settings() const void KCMKWinDecoration::reloadKWinSettings() { - QMetaObject::invokeMethod(m_themesModel, "init", Qt::QueuedConnection); + QMetaObject::invokeMethod(m_themesModel, &KDecoration2::Configuration::DecorationsModel::init, Qt::QueuedConnection); } void KCMKWinDecoration::load() diff --git a/src/libkwineffects/kwinanimationeffect.cpp b/src/libkwineffects/kwinanimationeffect.cpp index 0c67d260a2..a6ac3a46a4 100644 --- a/src/libkwineffects/kwinanimationeffect.cpp +++ b/src/libkwineffects/kwinanimationeffect.cpp @@ -50,7 +50,7 @@ AnimationEffect::AnimationEffect() : d_ptr(new AnimationEffectPrivate()) s_clock.start(); /* this is the same as the QTimer::singleShot(0, SLOT(init())) kludge * defering the init and esp. the connection to the windowClosed slot */ - QMetaObject::invokeMethod( this, "init", Qt::QueuedConnection ); + QMetaObject::invokeMethod(this, &AnimationEffect::init, Qt::QueuedConnection); } AnimationEffect::~AnimationEffect() diff --git a/src/plugins/platforms/x11/standalone/x11_platform.cpp b/src/plugins/platforms/x11/standalone/x11_platform.cpp index 21aad82f28..d935f36df8 100644 --- a/src/plugins/platforms/x11/standalone/x11_platform.cpp +++ b/src/plugins/platforms/x11/standalone/x11_platform.cpp @@ -292,7 +292,7 @@ void X11StandalonePlatform::createOpenGLSafePoint(OpenGLSafePoint safePoint) }, Qt::DirectConnection); } else { Q_ASSERT(m_openGLFreezeProtection); - QMetaObject::invokeMethod(m_openGLFreezeProtection, "start", Qt::QueuedConnection); + QMetaObject::invokeMethod(m_openGLFreezeProtection, QOverload<>::of(&QTimer::start), Qt::QueuedConnection); } break; case OpenGLSafePoint::PostInit: @@ -301,7 +301,7 @@ void X11StandalonePlatform::createOpenGLSafePoint(OpenGLSafePoint safePoint) // Deliberately continue with PostFrame Q_FALLTHROUGH(); case OpenGLSafePoint::PostFrame: - QMetaObject::invokeMethod(m_openGLFreezeProtection, "stop", Qt::QueuedConnection); + QMetaObject::invokeMethod(m_openGLFreezeProtection, &QTimer::stop, Qt::QueuedConnection); break; case OpenGLSafePoint::PostLastGuardedFrame: m_openGLFreezeProtection->deleteLater(); diff --git a/src/useractions.cpp b/src/useractions.cpp index 233e7002ce..5ae3774770 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -765,10 +765,7 @@ void UserActionsMenu::slotWindowOperation(QAction *action) // need to delay performing the window operation as we need to have the // user actions menu closed before we destroy the decoration. Otherwise Qt crashes qRegisterMetaType(); - QMetaObject::invokeMethod(workspace(), "performWindowOperation", - Qt::QueuedConnection, - Q_ARG(KWin::AbstractClient*, c), - Q_ARG(Options::WindowOperation, op)); + QMetaObject::invokeMethod(workspace(), std::bind(&Workspace::performWindowOperation, workspace(), c, op), Qt::QueuedConnection); } void UserActionsMenu::slotToggleOnActivity(QAction *action) @@ -1191,7 +1188,7 @@ void Workspace::performWindowOperation(AbstractClient* c, Options::WindowOperati c->performMouseCommand(Options::MouseUnrestrictedResize, Cursors::self()->mouse()->pos()); break; case Options::CloseOp: - QMetaObject::invokeMethod(c, "closeWindow", Qt::QueuedConnection); + QMetaObject::invokeMethod(c, &AbstractClient::closeWindow, Qt::QueuedConnection); break; case Options::MaximizeOp: c->maximize(c->maximizeMode() == MaximizeFull diff --git a/src/x11client.cpp b/src/x11client.cpp index c5031b3f1c..59e150cbbd 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -1117,7 +1117,7 @@ void X11Client::createDecoration(const QRect& oldgeom) { KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this); if (decoration) { - QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection); + QMetaObject::invokeMethod(decoration, QOverload<>::of(&KDecoration2::Decoration::update), Qt::QueuedConnection); connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::updateShadow); connect(decoration, &KDecoration2::Decoration::bordersChanged, this, &X11Client::updateDecorationInputShape);