summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2019-11-06 21:20:26 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-01 07:21:50 +0000
commitadae7b569e307a327ebfc56d34292c64edc73b00 (patch)
tree3d0d185fbb0be1bb514a3ccfb58f734784b41346
parent05a141e2a1bbf630c55a0ae435f1d5bd8c62a500 (diff)
PassThruCan: Switch from invokeMethod to PMF overload
Fixes: QTBUG-94838 Change-Id: I29002db6dca6c5f2e19bd463c7f83f44cba2d009 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Jonas Larsson <jonas.larsson@systemrefine.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com> (cherry picked from commit 62e7b5cc737db6c9fd29a04fc65a76d11db599bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/canbus/passthrucan/passthrucanbackend.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/canbus/passthrucan/passthrucanbackend.cpp b/src/plugins/canbus/passthrucan/passthrucanbackend.cpp
index 55f1567..f7ef6e3 100644
--- a/src/plugins/canbus/passthrucan/passthrucanbackend.cpp
+++ b/src/plugins/canbus/passthrucan/passthrucanbackend.cpp
@@ -215,10 +215,9 @@ bool PassThruCanBackend::open()
}
m_ioThread.start();
- return QMetaObject::invokeMethod(m_canIO, "open", Qt::QueuedConnection,
- Q_ARG(QString, library),
- Q_ARG(QByteArray, subDev),
- Q_ARG(uint, bitRate));
+ return QMetaObject::invokeMethod(m_canIO, [this, library, subDev, bitRate] {
+ m_canIO->open(library, subDev, bitRate);
+ }, Qt::QueuedConnection);
}
void PassThruCanBackend::close()
@@ -227,7 +226,7 @@ void PassThruCanBackend::close()
qCCritical(QT_CANBUS_PLUGINS_PASSTHRU, "Unexpected state on close");
return;
}
- QMetaObject::invokeMethod(m_canIO, "close", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(m_canIO, &PassThruCanIO::close, Qt::QueuedConnection);
}
void PassThruCanBackend::ackOpenFinished(bool success)
@@ -250,7 +249,7 @@ void PassThruCanBackend::ackOpenFinished(bool success)
}
applyConfig(RawFilterKey, filters);
- QMetaObject::invokeMethod(m_canIO, "listen", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(m_canIO, &PassThruCanIO::listen, Qt::QueuedConnection);
setState(ConnectedState);
} else {
@@ -268,6 +267,7 @@ void PassThruCanBackend::ackCloseFinished()
void PassThruCanBackend::applyConfig(QCanBusDevice::ConfigurationKey key, const QVariant &value)
{
- QMetaObject::invokeMethod(m_canIO, "applyConfig", Qt::QueuedConnection,
- Q_ARG(int, key), Q_ARG(QVariant, value));
+ QMetaObject::invokeMethod(m_canIO,
+ [this, key, value] { m_canIO->applyConfig(key, value); },
+ Qt::QueuedConnection);
}