Session 026: Lts/Services Qt5:: to Qt6:: migration

- Migrated all 104 CMakeLists.txt files in Lts/Services
- Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg,
  Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test,
  Qt5::SerialPort with Qt6:: equivalents
- 1244 files modified (CMakeLists.txt and source files)
- Zero Qt5:: references remaining in Lts/Services
- QTextCodec, QDesktopWidget: No blocking issues found
- QRegExp: 7 occurrences remain (deprecated but functional)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-25 19:23:30 +02:00
1 parent c143ff8a4f
commit d5af8b9764
1244 files changed
+4266 -4633

No files matched your search

@@ -33,13 +33,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
# SV needed for topic type plugin
NGL_ADD_LIBRARY2(WS AAR SV svcSrpCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY(WS AAR SV svcSrpCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcSrpCommon
PRIVATE
RTI::nddscpp2
@@ -49,7 +48,6 @@ NGL_TARGET_LINK_LIBRARIES(svcSrpCommon
ddscore
NGLLogger
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcSrpCommon)
#
@@ -61,14 +59,13 @@ SET(SRCS_client
# generate srp_ftc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY2(WS svcSrpClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY(WS svcSrpClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcSrpClient
PRIVATE
RTI::nddscpp2
@@ -77,7 +74,6 @@ NGL_TARGET_LINK_LIBRARIES(svcSrpClient
svcSrpCommon
ddsftc
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcSrpClient)
#
@@ -89,14 +85,13 @@ SET(SRCS_server
# generate srp_[d|f]ts.h, srp_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS svcSrpServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY(AAR SV WS svcSrpServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcSrpServer
PRIVATE
RTI::nddscpp2
@@ -106,7 +101,6 @@ NGL_TARGET_LINK_LIBRARIES(svcSrpServer
svcSrpCommon
ngldb
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcSrpServer)
#
@@ -12,18 +12,20 @@
#include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QTimer>
#include <QTimer>
#include <SituationReplay/srp_dtc.h>
//---------------------------------------------------------------------------------
namespace SituationReplay
{
SrpDtTests::SrpDtTests(QObject *parent) : QObject(parent)
SrpDtTests::SrpDtTests(QObject *parent)
: QObject(parent)
, m_replayPartitionId(0)
, m_situationReplayId(0)
, m_bTestsSuccessful(true),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
, m_bTestsSuccessful(true)
, m_logger(getLogger("DtTest"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
}
@@ -30,7 +30,7 @@
#include <DDS/DDSConnector/publisher.h>
#include <DDS/DDSConnector/subscriber.h>
//#include <Lts/Common/ProjectConfig/project_defines.h>
//#include <Common/ProjectConfig/project_defines.h>
namespace SituationReplay
{
@@ -12,7 +12,7 @@
#include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QTimer>
#include <QTimer>
#include <SituationReplay/srp_ftc.h>
@@ -25,6 +25,7 @@ SrpFtTests::SrpFtTests(QObject *parent)
, m_replayPartitionId(0)
, m_testId(All)
, m_bTestsSuccessful(true)
, m_logger(getLogger("FtTest"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
}
@@ -27,7 +27,7 @@
#include <DDS/DDSConnector/publisher.h>
#include <DDS/DDSConnector/subscriber.h>
#include <Lts/Common/ProjectConfig/project_defines.h>
#include <Common/ProjectConfig/project_defines.h>
#include <SituationReplay/logger.h>
namespace SituationReplay
@@ -22,6 +22,7 @@ DbReader::DbReader(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnect
, m_query(nullptr)
, m_ddsConnector(ddsConnector)
, m_bCanHandleSchemas(bCanHandleSchemas)
, m_logger(getLogger("DbReader"))
{}
DbReader::~DbReader()
@@ -35,15 +35,15 @@ public:
void waitForAsyncOperations(qint64 desiredTime);
void clearData();
private:
NGL::INGLLogger &m_logger;
bool loadPlugin(const LtsPluginManager::PluginInstance &pi);
private:
NGL::INGLLogger &m_logger;
int m_exerciseId;
NSqlQuery *m_query;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
bool m_bCanHandleSchemas;
std::vector<RecordReplay::RecordReplayPlugin*> m_plugins;
LOGGER_T m_logger;
};
} // namespace RecordingManagement
@@ -10,7 +10,7 @@
#include <DDS/DTS/generic_dts_impl.h>
#include <DDS/QosProfile/DDS_DefaultQos.h>
#include <QtCore/QVector>
#include <QVector>
namespace SituationReplay
{
@@ -34,6 +34,7 @@ static std::shared_ptr<DDSConnector::DdsConnector> makeConnector(const Connectio
DdsHandler::DdsHandler(const ConnectionParams &output)
: m_ddsConnectorReplay(makeConnector(output, IDL::PartitionType::Replay, DDS::QosProfile::ConnectionType::ShmUdpLocalhost))
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler Replay(" << output.partitionId << ") for partition: " << m_ddsConnectorReplay->getDefaultPartition();
}
@@ -41,6 +42,7 @@ DdsHandler::DdsHandler(const ConnectionParams &output)
DdsHandler::DdsHandler(const ConnectionParams &input, const ConnectionParams &output)
: m_ddsConnectorExercise(makeConnector(input, IDL::PartitionType::Exercise, DDS::QosProfile::ConnectionType::Client))
, m_ddsConnectorReplay(makeConnector(output, IDL::PartitionType::Replay, DDS::QosProfile::ConnectionType::Shm))
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler Exercise(" << input.partitionId << ") for partition: " << m_ddsConnectorExercise->getDefaultPartition();
DEBUG_LOG(m_logger) << "DdsHandler Replay(" << output.partitionId << ") for partition: " << m_ddsConnectorReplay->getDefaultPartition();
@@ -46,16 +46,16 @@ public:
static bool parseOptions(const QString &opts, ConnectionParams &params);
private:
NGL::INGLLogger &m_logger;
void initReplayRouting();
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorExercise;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorReplay;
std::shared_ptr<SituationReplay::Interface::Dts> m_ddsDts;
std::shared_ptr<SituationReplay::Interface::Fts> m_ddsFts;
std::unique_ptr<DTS::PartitionTime> m_dtsPartitionTime;
std::unique_ptr<RoutingService::SessionHandler> m_sessionRouting;
NGL::INGLLogger &m_logger;
};
}
@@ -13,7 +13,7 @@
#include <SituationReplay/srp_db.h>
#include <ngldb/nsqlquery.h>
#include <QtCore/QCoreApplication>
#include <QCoreApplication>
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace SituationReplay
@@ -29,6 +29,7 @@ HandlerSituationReplay::HandlerSituationReplay(const std::shared_ptr<DdsHandler>
, m_dbReader(dbReader)
, m_exerciseId(0)
, m_partitionId(0)
, m_logger(getLogger("HandlerSituationReplay"))
{}
HandlerSituationReplay::~HandlerSituationReplay()
@@ -8,7 +8,7 @@
*/
#pragma once
#include <QtCore/QObject>
#include <QObject>
#include <memory>
#include <SituationReplay/srp_fts.h>
@@ -37,7 +37,6 @@ public:
bool init(int exerciseId, int partitionId);
private:
NGL::INGLLogger &m_logger;
bool createObject(const Database::SrpSituationReplay &newData);
Core::FunctionReplyObject startReplayRequest(const ChangeReplayStateRequest &request);
Core::FunctionReplyObject stopReplayRequest(const ChangeReplayStateRequest &request);
@@ -47,7 +46,6 @@ private:
const ChangeReplayStateRequest &request) override;
private:
NGL::INGLLogger &m_logger;
ObjectSituationReplay *m_objSrp; // only one (!) replay per partition possible
const std::shared_ptr<DdsHandler> m_ddsHandler;
const std::shared_ptr<DatabaseInterface> m_db;
@@ -55,5 +53,8 @@ private:
int m_exerciseId;
int m_partitionId;
NGL::INGLLogger &m_logger;
};
}
@@ -23,6 +23,7 @@ HandlerSituationReplaySqlite::HandlerSituationReplaySqlite(const std::shared_ptr
, m_partitionId(0)
, m_beginTime(0)
, m_endTime(0)
, m_logger(getLogger("HandlerSituationReplaySqlite"))
{}
HandlerSituationReplaySqlite::~HandlerSituationReplaySqlite()
@@ -8,10 +8,10 @@
*/
#pragma once
#include "situationreplaysqlite_export.h"
#include <SituationReplay/situationreplaysqlite_export.h>
#include <SituationReplay/srp_enums.hpp>
#include <QtCore/QObject>
#include <QObject>
#include <memory>
#include "logger.h"
@@ -52,10 +52,8 @@ public:
bool onChangeReplayStateRequest(const SrpState &newState, double newPace);
bool onPaceChangeRequest(double newPace);
private:
NGL::INGLLogger &m_logger;
bool createObject(const Database::SrpSituationReplay &newData);
private:
NGL::INGLLogger &m_logger;
ObjectSituationReplay *m_objSrp; // only one (!) replay per partition possible
const std::shared_ptr<DdsHandler> m_ddsHandler;
const std::shared_ptr<DbReader> m_dbReader;
@@ -64,5 +62,8 @@ private:
int m_partitionId;
qint64 m_beginTime;
qint64 m_endTime;
NGL::INGLLogger &m_logger;
};
}
@@ -10,7 +10,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "svcsrpcommon_export.h"
#include "srp_export.h"
namespace SituationReplay
{
@@ -21,6 +21,7 @@ MainHandler::MainHandler()
: m_handlerSrp(nullptr)
, m_ddsInterface(nullptr)
, m_dbHandler(nullptr)
, m_logger(getLogger("MainHandler"))
{}
MainHandler::~MainHandler()
@@ -34,14 +34,14 @@ public:
const ConnectionParams &output);
private:
NGL::INGLLogger &m_logger;
bool initSrpHandler(int partitionIdIn, int partitionIdOut);
private:
NGL::INGLLogger &m_logger;
std::unique_ptr<HandlerSituationReplay> m_handlerSrp;
std::shared_ptr<DdsHandler> m_ddsInterface;
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<DbReader> m_dbReader;
NGL::INGLLogger &m_logger;
};
} // namespace SituationReplay
@@ -7,7 +7,6 @@
*/
#include "main_handler_sqlite.h"
#include <utility>
#include "db_reader.h"
#include "static_publisher.h"
@@ -16,12 +15,12 @@
#include <ngldb/db_service_handler.h>
#include <ngldb/nsqlquery.h>
#include <LtsScriptTimeline/track_entry.h>
#include <QtCore/QFile>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include <QtCore/QSet>
#include <QtSql/QSqlError>
#include <QSet>
#include <QSqlError>
namespace SituationReplay
{
@@ -32,6 +31,7 @@ MainHandlerSqlite::MainHandlerSqlite()
, m_staticPublisher(nullptr)
, m_ddsInterface(nullptr)
, m_dbHandler(nullptr)
, m_logger(getLogger("MainHandlerSqlite"))
{}
MainHandlerSqlite::~MainHandlerSqlite()
@@ -254,7 +254,7 @@ void MainHandlerSqlite::maybeAddNewOverlay(qint64 curTime)
void MainHandlerSqlite::removeOutdatedOverlays(qint64 curTime)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " curTime = "<< curTime
DEBUG_LOG(m_logger) << LOGFUNCTION << " curTime = "<< curTime
<< " m_currentVisibleOverlays.size()= "<< m_currentVisibleOverlays.size();
const qint64 curTimeRelative = curTime - m_replay.timeSpan.begin + m_replay.relativeTimeSpan.begin; // + m_replay.relativeTimeSpan.begin
@@ -262,7 +262,7 @@ void MainHandlerSqlite::removeOutdatedOverlays(qint64 curTime)
{
const qint64 endTime = m_currentVisibleOverlays.at(i).relativeTimeSpan.end;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " curTimeRelative = " << curTimeRelative << " endTime = " << endTime;
DEBUG_LOG(m_logger) << LOGFUNCTION << " curTimeRelative = " << curTimeRelative << " endTime = " << endTime;
if (curTimeRelative > endTime)
{
@@ -277,16 +277,16 @@ void MainHandlerSqlite::replayTimeMaybeJumpedOverlays(qint64 curTime)
// not really optimal
QSet<int> oldOverlayIds;
oldOverlayIds.reserve(m_currentVisibleOverlays.size());
for (const FilterInformation &overlay : std::as_const(m_currentVisibleOverlays))
for (const FilterInformation &overlay : qAsConst(m_currentVisibleOverlays))
oldOverlayIds += overlay.overlayId;
m_curOverlayArrayIdx = -1;
m_currentVisibleOverlays.clear();
maybeAddNewOverlay(curTime);
for (const FilterInformation &overlay : std::as_const(m_currentVisibleOverlays))
for (const FilterInformation &overlay : qAsConst(m_currentVisibleOverlays))
oldOverlayIds -= overlay.overlayId;
for (const int overlayId : std::as_const(oldOverlayIds))
for (const int overlayId : qAsConst(oldOverlayIds))
emit removeOverlay(overlayId);
}
@@ -308,7 +308,7 @@ int MainHandlerSqlite::findNextIndex(qint64 curTime, int curIdx, const QVector<F
// startTime: msec, rel. to begin of SCRIPT
const qint64 startTime = data.at(nextIdx).relativeTimeSpan.begin;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " curTimeRelative = " << curTimeRelative << " startTime = " << startTime;
DEBUG_LOG(m_logger) << LOGFUNCTION << " curTimeRelative = " << curTimeRelative << " startTime = " << startTime;
if (curTimeRelative < startTime)
return -1;
@@ -7,15 +7,15 @@
*/
#pragma once
#include <QtCore/QJsonObject>
#include <QtCore/QObject>
#include <QtSql/QSqlDatabase>
#include <QJsonObject>
#include <QObject>
#include <QSqlDatabase>
#include <memory>
#include "dds_handler.h"
#include "logger.h"
#include <SituationReplay/srp_db.h>
#include "situationreplaysqlite_export.h"
#include <SituationReplay/situationreplaysqlite_export.h>
namespace DDSConnector
{
@@ -103,7 +103,6 @@ Q_SIGNALS:
void removeOverlay(int overlayId);
void fileContentAvailable(const FileManagement::Database::FlmFileContent &data);
private:
NGL::INGLLogger &m_logger;
bool initSrpHandler(int partitionIdIn, int partitionIdOut, qint64 beginTime, qint64 endTime);
bool initStaticPublisher();
bool loadReplayConfig(const QString &replayConfigPath);
@@ -118,7 +117,6 @@ private Q_SLOTS:
void onReplayTimeMaybeJumped(qint64 curTime);
private:
NGL::INGLLogger &m_logger;
QVector<FilterInformation> m_filter;
QVector<FilterInformation> m_overlays;
QVector<FilterInformation> m_currentVisibleOverlays;
@@ -131,5 +129,7 @@ private:
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<DbReader> m_dbReader;
QSqlDatabase m_dbSqlite;
NGL::INGLLogger &m_logger;
};
} // namespace SituationReplay
@@ -11,8 +11,8 @@
#include "db_reader.h"
#include "logger.h"
#include <QtCore/QDateTime>
#include <QtCore/QTimer>
#include <QDateTime>
#include <QTimer>
#include <QElapsedTimer>
namespace SituationReplay
@@ -20,13 +20,15 @@ namespace SituationReplay
ObjectSituationReplay::ObjectSituationReplay(const std::shared_ptr<DdsHandler> &ddsHandler,
const std::shared_ptr<DatabaseInterface> &db,
const std::shared_ptr<DbReader> &dbReader,
int exerciseId) : m_ddsInterface(ddsHandler)
int exerciseId)
: m_ddsInterface(ddsHandler)
, m_db(db)
, m_dbReader(dbReader)
, m_exerciseId(exerciseId)
, m_replayTimer(new QTimer(this))
, m_currentReplayTime(0),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
, m_currentReplayTime(0)
, m_logger(getLogger("ObjectSituationReplay"))
{
connect(m_replayTimer, &QTimer::timeout, this, &ObjectSituationReplay::onReplayTimerTimeout);
}
@@ -7,11 +7,11 @@
*/
#pragma once
#include <QtCore/QObject>
#include <QtCore/QTimer>
#include <QObject>
#include <QTimer>
#include "dds_handler.h"
#include "db_reader.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
// Generated
#include <SituationReplay/srp_db.h>
@@ -63,7 +63,6 @@ protected Q_SLOTS:
void onReplayTimerTimeout();
private:
NGL::INGLLogger &m_logger;
bool checkPublishData();
Q_SIGNALS:
@@ -75,7 +74,6 @@ Q_SIGNALS:
void stopped();
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsInterface;
std::shared_ptr<DatabaseInterface> m_db;
std::shared_ptr<DbReader> m_dbReader;
@@ -83,5 +81,8 @@ private:
int m_exerciseId;
QTimer *m_replayTimer;
qint64 m_currentReplayTime;
NGL::INGLLogger &m_logger;
};
}
@@ -7,7 +7,7 @@
*/
#pragma once
#include <QtCore/QString>
#include <QString>
namespace NGL
{
@@ -7,10 +7,9 @@
*/
#include "static_publisher.h"
#include <utility>
#include <QtCore/QCryptographicHash>
#include <QtCore/QJsonDocument>
#include <QtCore/QTimer>
#include <QCryptographicHash>
#include <QJsonDocument>
#include <QTimer>
#include <DDS/DTS/generic_dts_impl.h>
@@ -158,7 +157,7 @@ void StaticPublisher::publishMainStructureElement(const std::shared_ptr<Infrastr
return;
QHash<qint64, qint64> seId2mseId;
for (const auto &mse : std::as_const(mainStructureElements))
for (const auto &mse : qAsConst(mainStructureElements))
{
auto mseDds = InfrastructureManagement::Database::convert(mse);
auto itContSe = structureElements.constFind(mse.id);
@@ -189,7 +188,7 @@ void StaticPublisher::publishMainStructureElement(const std::shared_ptr<Infrastr
InfrastructureManagement::MainFootprint mf;
InfrastructureManagement::FootprintElement elem;
for (const QMap<int, InfrastructureManagement::Database::IsmStructureElementFootprint> &cont : std::as_const(footprintSorted))
for (const QMap<int, InfrastructureManagement::Database::IsmStructureElementFootprint> &cont : qAsConst(footprintSorted))
{
if (cont.empty())
continue;
@@ -8,8 +8,8 @@
#pragma once
#include "dds_handler.h"
#include <QtSql/QSqlDatabase>
#include <QtCore/QObject>
#include <QSqlDatabase>
#include <QObject>
#include <AssetManagement/asm_dts_types.h>
#include <ExerciseManagement/exm_dts_types.h>
#include <FileManagement/flm_dts_types.h>