diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/serialbus/qmodbusrtuserialslave_p.h | 4 | ||||
-rw-r--r-- | src/serialbus/qmodbustcpclient_p.h | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/serialbus/qmodbusrtuserialslave_p.h b/src/serialbus/qmodbusrtuserialslave_p.h index f613077..b25a039 100644 --- a/src/serialbus/qmodbusrtuserialslave_p.h +++ b/src/serialbus/qmodbusrtuserialslave_p.h @@ -280,8 +280,8 @@ public: storeModbusCommEvent(event); // store the final event after processing }); - using TypeId = void (QSerialPort::*)(QSerialPort::SerialPortError); - QObject::connect(m_serialPort, static_cast<TypeId>(&QSerialPort::error), q, + QObject::connect(m_serialPort, + QOverload<QSerialPort::SerialPortError>::of(&QSerialPort::error), q, [this](QSerialPort::SerialPortError error) { if (error == QSerialPort::NoError) return; diff --git a/src/serialbus/qmodbustcpclient_p.h b/src/serialbus/qmodbustcpclient_p.h index 16f81c2..649b48e 100644 --- a/src/serialbus/qmodbustcpclient_p.h +++ b/src/serialbus/qmodbustcpclient_p.h @@ -86,8 +86,8 @@ public: cleanupTransactionStore(); }); - using TypeId = void (QAbstractSocket::*)(QAbstractSocket::SocketError); - QObject::connect(m_socket, static_cast<TypeId>(&QAbstractSocket::error), q, + QObject::connect(m_socket, + QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), q, [this](QAbstractSocket::SocketError /*error*/) { Q_Q(QModbusTcpClient); @@ -193,9 +193,8 @@ public: }); if (element.timer) { - using TypeId = void (QTimer::*)(int); q->connect(q, &QModbusClient::timeoutChanged, - element.timer.data(), static_cast<TypeId>(&QTimer::setInterval)); + element.timer.data(), QOverload<int>::of(&QTimer::setInterval)); QObject::connect(element.timer.data(), &QTimer::timeout, q, [this, writeToSocket, tId]() { if (!m_transactionStore.contains(tId)) return; |