Consider QSerialPort::error deprecation properly

master
Simon Stürz 2025-08-21 15:27:13 +02:00
parent feb80fb113
commit b670971979
5 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,7 @@ EVBoxPort::EVBoxPort(const QString &portName, QObject *parent)
m_serialPort->setParity(QSerialPort::NoParity);
connect(m_serialPort, &QSerialPort::readyRead, this, &EVBoxPort::onReadyRead);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
connect(m_serialPort, &QSerialPort::errorOccurred, this, [this](){
#else
connect(m_serialPort, static_cast<void(QSerialPort::*)(QSerialPort::SerialPortError)>(&QSerialPort::error), this, [=](){

View File

@ -109,7 +109,7 @@ void IntegrationPluginSerialPortCommander::setupThing(ThingSetupInfo *info)
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Could not open serial port."));
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
connect(serialPort, &QSerialPort::errorOccurred, this, &IntegrationPluginSerialPortCommander::onSerialError);
#else
connect(serialPort, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(onSerialError(QSerialPort::SerialPortError)));

View File

@ -423,7 +423,7 @@ void IntegrationPluginTPLink::connectToDevice(Thing *thing, const QHostAddress &
fetchState(thing);
});
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(socket, &QTcpSocket::errorOccurred, this, [](QAbstractSocket::SocketError error){
#else
typedef void (QTcpSocket:: *errorSignal)(QAbstractSocket::SocketError);

View File

@ -192,7 +192,7 @@ bool UsbRly82::connectRelay(const QString &serialPort)
}
connect(m_serialPort, &QSerialPort::readyRead, this, &UsbRly82::onReadyRead);
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
connect(m_serialPort, &QSerialPort::errorOccurred, this, &UsbRly82::onError, Qt::QueuedConnection);
#else
connect(m_serialPort, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(onError(QSerialPort::SerialPortError)), Qt::QueuedConnection);

View File

@ -78,7 +78,7 @@ void IntegrationPluginWs2812fx::setupThing(ThingSetupInfo *info)
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Error opening serial port."));
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
connect(serialPort, &QSerialPort::errorOccurred, this, &IntegrationPluginWs2812fx::onSerialError);
#else
connect(serialPort, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(onSerialError(QSerialPort::SerialPortError)));