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

@@ -32,13 +32,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate nom_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS svcNomCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY(AAR SV WS svcNomCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcNomCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcNomCommon
PRIVATE
RTI::nddscpp2
@@ -49,7 +48,6 @@ NGL_TARGET_LINK_LIBRARIES(svcNomCommon
LtsCommandLineParser
NGLLogger
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcNomCommon)
#
@@ -61,14 +59,13 @@ SET(SRCS_client
# generate nom_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS svcNomClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY(AAR SV WS svcNomClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcNomClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcNomClient
PRIVATE
RTI::nddscpp2
@@ -77,7 +74,6 @@ NGL_TARGET_LINK_LIBRARIES(svcNomClient
svcNomCommon
ddsftc
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcNomClient)
#
@@ -89,14 +85,13 @@ SET(SRCS_server
# generate nom_[d|f]ts.h, nom_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV svcNomServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY(AAR SV svcNomServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcNomServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcNomServer
PRIVATE
RTI::nddscpp2
@@ -106,7 +101,6 @@ NGL_TARGET_LINK_LIBRARIES(svcNomServer
svcNomCommon
ngldb
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcNomServer)
#
@@ -10,10 +10,10 @@
#include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QTimer>
#include <QtCore/QDateTime>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <QTimer>
#include <QDateTime>
#include <QString>
#include <QVector>
#include <NotificationManagement/nom_ftc.h>
#include <NotificationManagement/nom_dtc.h>
@@ -23,7 +23,7 @@
#include <NotificationManagement/settings.h>
#include <LtsUtilsSettings/settings.h>
#include <nglsettings/nglsettings_settings.h>
#include <QtCore/QSettings>
#include <QSettings>
using namespace NotificationManagement;
@@ -35,6 +35,7 @@ NomTests::NomTests(QObject *parent)
, m_notificationId(0)
, m_eTestStep(eUnknown)
, m_bTestsSuccessful(true)
, m_logger(getLogger("NomTests"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
} // end of ctor()
@@ -63,7 +63,6 @@ protected Q_SLOTS:
void onReceiveNotificationChanged(const NomNotification &data, DataModification modType);
protected:
NGL::INGLLogger &m_logger;
// Callbackfunctions for FTC
void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override final;
void onReadReceiptReply(const Core::FunctionReplyObject &reply) override final;
@@ -97,6 +96,8 @@ private:
} m_eTestStep;
bool m_bTestsSuccessful;
NGL::INGLLogger &m_logger;
};
} // namespace NotificationManagement
@@ -15,6 +15,7 @@ namespace NotificationManagement
DdsHandler::DdsHandler(int domainId)
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::AllExercises))
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
} // end of ctor()DdsHandler
@@ -47,7 +47,6 @@ public:
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
std::shared_ptr<Core::Pacemaker> m_pacemaker;
@@ -56,6 +55,7 @@ private:
std::shared_ptr<NotificationManagement::Interface::Fts> m_ddsFts;
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_dtcExm;
std::shared_ptr<OperatorManagement::Interface::Dtc> m_dtcOpm;
NGL::INGLLogger &m_logger;
};
}
@@ -7,7 +7,6 @@
*/
#include "handler_notification.h"
#include <utility>
#include "object_notification.h"
#include "dds_handler.h"
#include "settings.h"
@@ -25,6 +24,7 @@ HandlerNotification::HandlerNotification(const std::shared_ptr<DdsHandler> &ddsH
, m_removeNotificationTimer(new QTimer())
, m_ddsHandler(ddsHandler)
, m_db(db)
, m_logger(getLogger("HandlerNotification"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -64,7 +64,7 @@ bool HandlerNotification::init()
}
// alle Addressen zu der NomNotification eintragen
for (const Database::NomAddress &addr : std::as_const(dataAddressVec))
for (const Database::NomAddress &addr : qAsConst(dataAddressVec))
{
if (addr.notificationId == notif.id())
{
@@ -9,7 +9,7 @@
#include "dds_handler.h"
#include <NotificationManagement/nom_db.h>
#include <QtCore/QTimer>
#include <QTimer>
namespace NotificationManagement
{
@@ -33,8 +33,6 @@ public:
bool init();
private: // methods
NGL::INGLLogger &m_logger;
void onCreateNotificationRequest(const rti::core::SampleIdentity &cookie,
const CreateNotification &request) override final;
void onReadReceiptRequest(const rti::core::SampleIdentity &cookie,
@@ -52,6 +50,8 @@ private: // attributes
QTimer* m_removeNotificationTimer;
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DatabaseInterface> m_db;
NGL::INGLLogger &m_logger;
QHash<int, ObjectNotification *> m_objectNotificationMap; // Key = notificationId
};
@@ -9,7 +9,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "svcnomcommon_export.h"
#include "nom_export.h"
namespace NotificationManagement
{
@@ -32,12 +32,10 @@ public:
bool init(int domainId);
private: // attributes
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler; ///< Pointer to DDS handler
std::shared_ptr<DbHandler> m_dbHandler; ///< Pointer to DB handler
std::shared_ptr<HandlerNotification> m_handlerNotification;
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace NotificationManagement
@@ -7,13 +7,12 @@
*/
#include "object_notification.h"
#include <utility>
#include "dds_handler.h"
#include <ngldb/dbtransaction.h>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
namespace NotificationManagement
{
@@ -25,6 +24,7 @@ const QString CONTENT_ARG = QStringLiteral("contentArg");
ObjectNotification::ObjectNotification(const std::shared_ptr<DdsHandler> &ddsHandler, const std::shared_ptr<DatabaseInterface> &db)
: m_ddsHandler(ddsHandler)
, m_db(db)
, m_logger(getLogger("ObjectNotification"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -96,7 +96,7 @@ QString ObjectNotification::contentArgsToJson()
int i = 1;
QJsonArray jsonArray;
for (const std::string& arg : std::as_const(m_dataNotificationObject.contentArgs()))
for (const std::string& arg : qAsConst(m_dataNotificationObject.contentArgs()))
{
DEBUG_LOG(m_logger) << ".arg() ersetzt immer den kleinsten freien Platzhalter"
<< ", arg=" << arg;
@@ -138,7 +138,7 @@ std::vector<std::string> ObjectNotification::jsonToContentArgs(const QString &js
{
// 3. Für schnellen Zugriff nach ID indizieren
QHash<int, QJsonObject> sucheMap;
for (const QJsonValue &wert : std::as_const(jsonArray))
for (const QJsonValue &wert : qAsConst(jsonArray))
{
QJsonObject obj = wert.toObject();
int id = obj[CONTENT_ID].toInt();
@@ -168,7 +168,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
Database::NomAddress dbDataAddr;
for (const Address &recipientAddr : std::as_const(m_dataNotificationObject.recipientIds()))
for (const Address &recipientAddr : qAsConst(m_dataNotificationObject.recipientIds()))
{
if (data.operatorId() > 0 && recipientAddr.addressType() == AddressType_def::Operator && recipientAddr.addressId() != data.operatorId())
continue;
@@ -223,7 +223,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
m_dataNotificationObject = toDdsData(dbDataNotification);
m_dataNotificationObject.sender(sender);
for (const Address &addr : std::as_const(recipients))
for (const Address &addr : qAsConst(recipients))
{
if (addr.id() == dbDataAddr.id)
m_dataNotificationObject.recipientIds().push_back(toDdsData(dbDataAddr));
@@ -247,7 +247,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
Database::NomAddress dbDataAddr;
for (const Address &recipientAddr : std::as_const(m_dataNotificationObject.recipientIds()))
for (const Address &recipientAddr : qAsConst(m_dataNotificationObject.recipientIds()))
{
DEBUG_LOG(m_logger) << "recipientAddr="
<< ", id: " << recipientAddr.id() << ", addressId: " << recipientAddr.addressId() << ", isDeleted: " << recipientAddr.isDeleted();
@@ -282,7 +282,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
m_dataNotificationObject = toDdsData(dbDataNotification);
m_dataNotificationObject.sender(sender);
for (const Address &addr : std::as_const(recipients))
for (const Address &addr : qAsConst(recipients))
{
DEBUG_LOG(m_logger) << "addr="
<< ", id: " << addr.id() << ", addressId: " << addr.addressId() << ", isDeleted: " << addr.isDeleted();
@@ -10,7 +10,7 @@
#include "dds_handler.h"
//#include "nom_db.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
// Generated
#include <NotificationManagement/nom_db.h>
@@ -50,15 +50,16 @@ public:
static Address toDdsData(const Database::NomAddress &dbData); // db -> dds
private:
NGL::INGLLogger &m_logger;
void onPublishData();
QString contentArgsToJson();
static std::vector<std::string> jsonToContentArgs(const QString &properties);
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DatabaseInterface> m_db;
NomNotification m_dataNotificationObject;
NGL::INGLLogger &m_logger;
};
} // namespace NotificationManagement
@@ -6,7 +6,7 @@
*/
#pragma once
#include <QtCore/QString>
#include <QString>
namespace NGL
{