SIGNAL/SLOT migration: socket_handler (5), targettimer (1), socketreader (2) + status update

- Migrated old SIGNAL/SLOT connect syntax to function-pointer syntax
- socket_handler.cpp: timeout, connected, disconnected, readyRead, bytesWritten
- targettimer.cpp: timeout → MyTimerSlot
- socketreader.cpp: readyRead, error (with QOverload for overloaded signal)
- Updated MIGRATION_STATUS.md with migration progress
- Part of Qt5→Qt6 migration with C++17 constraint (RTI 7.7.0 compatibility)
This commit is contained in:
torsten committed 2026-08-25 09:16:43 +02:00
1 parent bf0b1a3ddd
commit 060792032b
4 files changed
+22 -14

No files matched your search

@@ -24,8 +24,9 @@ bool SocketReader::init(const QString &host, quint16 port, int hlaRequestIdentif
DEBUG_LOG(m_logger) << "SR " << hlaRequestIdentifier << ": Trying to establish connection to " << host << ":" << port;
m_hlaRequestIdentifier = hlaRequestIdentifier;
connect(m_socket, SIGNAL(readyRead()), this, SLOT(onReadyRead()));
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onSocketError(QAbstractSocket::SocketError)));
connect(m_socket, &QTcpSocket::readyRead, this, &SocketReader::onReadyRead);
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
this, &SocketReader::onSocketError);
m_socket->connectToHost(host, port, QIODevice::ReadOnly);
return m_socket->waitForConnected(1000);
@@ -20,8 +20,8 @@ TargetTimer::TargetTimer(int participantId,
m_preWarningInterval = preWarningInterval;
m_timeToEffectInterval = timeToEffectInterval;
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()),
this, SLOT(MyTimerSlot()));
connect(timer, &QTimer::timeout,
this, &TargetTimer::MyTimerSlot);
// msec
}
@@ -28,8 +28,8 @@ SocketHandler::SocketHandler(const std::shared_ptr<DdsHandler> &ddsHandler,
m_reconnectTimer = new QTimer(this);
// setup signal and slot
connect(m_reconnectTimer, SIGNAL(timeout()),
this, SLOT(reconnectTimerSlot()));
connect(m_reconnectTimer, &QTimer::timeout,
this, &SocketHandler::reconnectTimerSlot);
}
@@ -38,11 +38,11 @@ void SocketHandler::init(QString nmeaHost, int nmeaPort)
m_nmeaHost = nmeaHost;
m_nmeaPort = nmeaPort;
socket = new QUdpSocket(this);
connect(socket, SIGNAL(connected()), this, SLOT(connected()));
connect(socket, SIGNAL(disconnected()), this, SLOT(disconnected()));
connect(socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
connect(socket, &QUdpSocket::connected, this, &SocketHandler::connected);
connect(socket, &QUdpSocket::disconnected, this, &SocketHandler::disconnected);
connect(socket, &QUdpSocket::readyRead, this, &SocketHandler::readyRead);
connect(socket, SIGNAL(bytesWritten(qint64)), this, SLOT(bytesWritten(qint64)));
connect(socket, &QUdpSocket::bytesWritten, this, &SocketHandler::bytesWritten);
INFO_LOG(m_logger) << "Connecting,..";
INFO_LOG(m_logger) << nmeaHost << " port: " << nmeaPort;
@@ -1,6 +1,6 @@
# Qt6 Migration Status - Legatus
## Zusammenfassung (Stand: 2026-08-21)
## Zusammenfassung (Stand: 2026-08-24)
### ✅ Erfolgreich abgeschlossene Arbeiten
@@ -39,6 +39,13 @@
- Pfad von `qt6-migrated-benchmark` → `qt6-migrated-legatus` korrigiert
- C++23 Reference Member Initialization Fixes (svcGmpServer)
6. **SIGNAL/SLOT → Function-Pointer Migration**
- ✅ Lts/Services/NmeaManagement/socket_handler.cpp (5 connect-Aufrufe)
- ✅ Lts/Services/CentralEffectSimulation/Plugins/TargetAreas/targettimer.cpp (1 connect-Aufruf)
- ✅ Lts/Proxies/HighLevelArchitecture/Apache/socketreader.cpp (2 connect-Aufrufe, QOverload für error-Signal)
- ✅ QRegExp → QRegularExpression in allen Modulen abgeschlossen
- ✅ QDesktopWidget → QScreen API in allen Modulen abgeschlossen
### ⚠️ Bekannte Einschränkungen
1. **Policy-Check** (`ci/check_pr_policies.py`)
@@ -124,6 +131,6 @@ docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \
```
---
**Letzter Build**: Erfolgreich (1940 Targets)
**Nächster Meilenstein**: BUILD_RTI Guards vervollständigen, dann BUILD_RTI=ON Validierung
**Letzter Commit**: 93020295 - Add BUILD_RTI guards to InfrastructureManagement and AudioVideoManagement DDS handlers
**Letzter Build**: Erfolgreich (1940 Targets mit BUILD_RTI=OFF)
**Nächster Meilenstein**: SIGNAL/SLOT Migration fortsetzen (lts_app_descriptor_editor.cpp, qsql_informix.cpp), dann BUILD_RTI=ON Validierung
**Letzter Commit**: bf0b1a3d - SIGNAL/SLOT migration: socket_handler, targettimer, socketreader + QDesktopWidget → QScreen