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

@@ -34,13 +34,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate flm_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS svcFlmCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY(AAR SV WS svcFlmCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcFlmCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcFlmCommon
PRIVATE
RTI::nddscpp2
@@ -51,7 +50,6 @@ NGL_TARGET_LINK_LIBRARIES(svcFlmCommon
LtsUtilsCore
NGLLogger
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcFlmCommon)
#
@@ -65,14 +63,13 @@ SET(SRCS_client
# generate flm_ftc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY2(WS AAR SV svcFlmClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY(WS AAR SV svcFlmClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcFlmClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcFlmClient
PRIVATE
RTI::nddscpp2
@@ -81,7 +78,6 @@ NGL_TARGET_LINK_LIBRARIES(svcFlmClient
svcFlmCommon
ddsftc
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcFlmClient)
#
@@ -95,14 +91,13 @@ SET(SRCS_server
# generate flm_[d|f]ts.h, flm_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY2(WS AAR SV svcFlmServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY(WS AAR SV svcFlmServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcFlmServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcFlmServer
PRIVATE
RTI::nddscpp2
@@ -113,7 +108,6 @@ NGL_TARGET_LINK_LIBRARIES(svcFlmServer
ngldb
LtsUtilsCore
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcFlmServer)
#
@@ -11,21 +11,20 @@
*/
#include "flm_tests.h"
#include <utility>
#include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QTimer>
#include <QtCore/QDateTime>
#include <QtTest/QTest>
#include <QtCore/QSet>
#include <QtCore/QVector>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonDocument>
#include <QTimer>
#include <QDateTime>
#include <QTest>
#include <QSet>
#include <QVector>
#include <QJsonObject>
#include <QJsonDocument>
#include <LtsUtils/pgarray.h>
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
#include <LtsUtilsCore/pgarray.h>
#include <LtsUtilsCore/dds_vector.h>
#include <FileManagement/flm_ftc.h>
#include <FileManagement/flm_dtc.h>
#include <FileManagement/settings.h>
@@ -53,6 +52,7 @@ FlmTests::FlmTests(QObject *parent)
, m_fileContentId(-1)
, m_operatorId(99)
, m_bTestsSuccessful(true)
, m_logger(getLogger("Test"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
}
@@ -690,7 +690,7 @@ void FlmTests::tryGetAllTemplates()
}
DEBUG_LOG(m_logger) << "Found " << allTemplates.size() << " templates";
for (const FileContent &fc : std::as_const(allTemplates))
for (const FileContent &fc : qAsConst(allTemplates))
DEBUG_LOG(m_logger) << "Found template (id, name) = (" << fc.id() << ", " << fc.name() << ")";
QTest::qWait(1000);
@@ -710,7 +710,7 @@ void FlmTests::tryGetAllPlans()
}
DEBUG_LOG(m_logger) << "Found " << allPlans.size() << " plans";
for (const QString &plan : std::as_const(allPlans))
for (const QString &plan : qAsConst(allPlans))
DEBUG_LOG(m_logger) << "Found plan = " << plan;
QTest::qWait(1000);
@@ -730,7 +730,7 @@ void FlmTests::tryGetAllFavs()
}
DEBUG_LOG(m_logger) << "Found " << allFavs.size() << " favs";
for (const QString &fav : std::as_const(allFavs))
for (const QString &fav : qAsConst(allFavs))
DEBUG_LOG(m_logger) << "Found fav = " << fav;
QTest::qWait(1000);
@@ -750,7 +750,7 @@ void FlmTests::tryGetAllSymbols()
}
DEBUG_LOG(m_logger) << "Found " << allSymbols.size() << " symbols";
for (const QString &symbol : std::as_const(allSymbols))
for (const QString &symbol : qAsConst(allSymbols))
DEBUG_LOG(m_logger) << "Found symbol = " << symbol;
QTest::qWait(1000);
@@ -21,7 +21,7 @@
#include <DDS/DDSConnector/dds_connector.h>
#include <FileManagement/logger.h>
#include <QtGui/QPixmap>
#include <QPixmap>
#include <ngldb/db_service_handler.h>
namespace FileManagement
@@ -49,12 +49,14 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS
ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
: LtsWebSocket::AbstractClientMessage(client, type, typeId, uuid, data)
, m_dataManager(dataManager)
, m_logger(getLogger("ClientMessage"))
{}
// ####### ClientMessage end #######
// ####### BaseDlRequest begin #######
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data) : ClientMessage(dataManager, client, type, typeId, uuid, data),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
: ClientMessage(dataManager, client, type, typeId, uuid, data)
{}
void BaseDlRequest::process()
{
@@ -10,8 +10,8 @@
#include <LtsWebSocket/reply_message.h>
#include <QtCore/QJsonArray>
#include <QtCore/QString>
#include <QJsonArray>
#include <QString>
namespace FileManagement
{
@@ -8,7 +8,7 @@
*/
#pragma once
#include <QtCore/QString>
#include <QString>
#include <OcBaseDownload/WebSocketInterface/json_keys.h>
@@ -24,6 +24,7 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
, m_messageFactory(nullptr)
, m_dataManager(nullptr)
, m_mainHandler(mainHandler)
, m_logger(getLogger("WebSocketInterfaceHandler"))
{
}
@@ -22,7 +22,6 @@ class Base : public QObject
{
Q_OBJECT
protected:
NGL::INGLLogger &m_logger;
explicit Base(MainHandler *mainHandler, NGL::INGLLogger &logger, QObject *parent = nullptr);
virtual ~Base();
@@ -33,5 +32,6 @@ NGL::INGLLogger &m_logger;
protected:
MainHandler *m_mainHandler;
LOGGER_T m_logger;
};
}
@@ -10,7 +10,7 @@
#include <FileManagement/flm_db.h>
#include <FileManagement/flm.hpp>
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
#include <LtsUtilsCore/dds_vector.h>
namespace FileManagement
{
@@ -16,6 +16,7 @@ namespace FileManagement
DdsHandler::DdsHandler(int domainId)
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
}
@@ -40,13 +40,14 @@ public:
std::shared_ptr<FileManagement::Interface::Fts> fts() const { return m_ddsFts; }
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::Pacemaker> m_pacemaker;
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
std::shared_ptr<FileManagement::Interface::Dts> m_ddsDts;
std::shared_ptr<FileManagement::Interface::Dtc> m_ddsDtc;
std::shared_ptr<FileManagement::Interface::Fts> m_ddsFts;
NGL::INGLLogger &m_logger;
};
}
@@ -9,7 +9,7 @@
#include "flm_db_impl_custom.h"
#include <ngldb/nsqlquery.h>
#include <ngldb/sql_query_janitor.h>
#include <QtCore/QRegularExpression>
#include <QRegularExpression>
namespace FileManagement
{
@@ -12,8 +12,8 @@
#include <DDS/DTC/generic_dtc.h>
#include <DDS/Generic/generic_data_reader.h>
#include <QtCore/QSet>
#include <QtCore/QVector>
#include <QSet>
#include <QVector>
#include <unordered_map>
//---------------------------------------------------------------------------------------------------------------------------------------------
@@ -14,8 +14,8 @@
#include "flm_db.h"
#include "convert_db_to_dds.h"
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QDir>
#include <QFile>
//----------------------------------------------------------------------------------------------------------------------------
namespace FileManagement
@@ -9,8 +9,8 @@
#pragma once
#include <QtCore/QMap>
#include <QtCore/QVariant>
#include <QMap>
#include <QVariant>
#include "base.h"
@@ -16,8 +16,9 @@
//------------------------------------------------------------------------------------------------------
namespace FileManagement
{
HandlerFileTypeInfo::HandlerFileTypeInfo(MainHandler *mainHandler) : Base(mainHandler, getLogger("HandlerFileTypeInfo")),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
HandlerFileTypeInfo::HandlerFileTypeInfo(MainHandler *mainHandler)
: Base(mainHandler, getLogger("HandlerFileTypeInfo"))
{}
//------------------------------------------------------------------------------------------------------
HandlerFileTypeInfo::~HandlerFileTypeInfo()
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QMap>
#include <QMap>
#include "base.h"
@@ -29,8 +29,6 @@ public:
QString getFileExtension(const FileManagement::FileType &fileType) const;
private:
NGL::INGLLogger &m_logger;
QMap<int, ObjectFileTypeInfo *> m_objectFileTypeInfoMap;
};
}
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QMap>
#include <QMap>
#include "base.h"
@@ -10,7 +10,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "svcflmcommon_export.h"
#include "flm_export.h"
namespace FileManagement
{
@@ -21,14 +21,16 @@
namespace FileManagement
{
MainHandler::MainHandler(QObject *parent) : QObject(parent)
MainHandler::MainHandler(QObject *parent)
: QObject(parent)
, m_ddsHandler(nullptr)
, m_dbHandler(nullptr)
, m_handlerFileTypeInfo(nullptr)
, m_handlerFolder(nullptr)
, m_handlerFileContent(nullptr)
, m_handlerWebSocket(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
, m_handlerWebSocket(nullptr)
, m_logger(getLogger("MainHandler"))
{}
MainHandler::~MainHandler()
{
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QObject>
#include <QObject>
#include "dds_handler.h"
#include "flm_db.h"
#include "logger.h"
@@ -45,11 +45,9 @@ public:
int exerciseId() const;
private:
NGL::INGLLogger &m_logger;
bool initFlmHandler();
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<HandlerFileTypeInfo> m_handlerFileTypeInfo;
@@ -58,5 +56,8 @@ private:
std::shared_ptr<WebSocketInterface::WebSocketInterfaceHandler> m_handlerWebSocket;
std::unique_ptr<ThpScriptServer> m_thpScriptServer;
std::unique_ptr<PdfServer> m_pdfServer;
NGL::INGLLogger &m_logger;
};
} // namespace FileManagement
@@ -11,7 +11,7 @@
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
// Generated
#include <FileManagement/flm_db.h>
@@ -11,7 +11,7 @@
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
// Generated
#include <FileManagement/flm_db.h>
@@ -11,7 +11,7 @@
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
// Generated
#include <FileManagement/flm_db.h>
@@ -16,8 +16,10 @@
namespace FileManagement
{
CBI_PdfDownload::CBI_PdfDownload(unsigned short port) : CommandInterface(port, "PDF_DOWNLOAD"),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
CBI_PdfDownload::CBI_PdfDownload(unsigned short port)
: CommandInterface(port, "PDF_DOWNLOAD")
, m_logger(getLogger("PdfDownload"))
{}
void CBI_PdfDownload::handleCommandInternal(const QVector<QByteArray> &args)
{
@@ -26,10 +26,9 @@ public:
QString help() const override;
protected:
NGL::INGLLogger &m_logger;
void handleCommandInternal(const QVector<QByteArray> &args) override;
private:
NGL::INGLLogger &m_logger;
};
} // namespace FileManagement
@@ -16,9 +16,11 @@
namespace FileManagement
{
PdfServer::PdfServer(MainHandler *mainHandler, QObject *parent) : QObject(parent)
, m_tcpServer(TcpServer::instance(NGL::Connections::port(NGL::Connections::eConnection::FLM_PDF_SERVER))),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
PdfServer::PdfServer(MainHandler *mainHandler, QObject *parent)
: QObject(parent)
, m_tcpServer(TcpServer::instance(NGL::Connections::port(NGL::Connections::eConnection::FLM_PDF_SERVER)))
, m_logger(getLogger("PdfServer"))
{
m_tcpServer->setUserData(mainHandler);
m_tcpServer->setUseWorkerThreads(false);
}
@@ -8,7 +8,7 @@
*/
#pragma once
#include <QtCore/QObject>
#include <QObject>
#include <tcpserver/tcpserver.h>
#include "logger.h"
@@ -27,7 +27,7 @@ public:
bool init();
private:
NGL::INGLLogger &m_logger;
TcpServer *m_tcpServer;
NGL::INGLLogger &m_logger;
};
} // namespace FileManagement
@@ -13,7 +13,7 @@
#include <nglsettings/nglsettings_settings.h>
#include <ngltools/ngltools_filesystem.h>
#include "LtsUtils/LtsUtilsCore/lts_portrange.h"
#include "LtsUtilsCore/lts_portrange.h"
namespace FileManagement
{
@@ -8,8 +8,8 @@
*/
#pragma once
#include <QtCore/QString>
#include <QtCore/QPair>
#include <QString>
#include <QPair>
namespace NGL
{
@@ -1,5 +1,4 @@
#include "thp_script_httq.h"
#include <utility>
#include "logger.h"
#include <httq/HttpRequest.h>
@@ -10,20 +9,20 @@
#include <Common2Core/tpm_tools.h>
#include <Common2Core/tpm_js_parser.h>
#include <QtWebSockets/QWebSocket>
#include <QtWebSockets/QWebSocketServer>
#include <QtCore/QFile>
#include <QWebSocket>
#include <QWebSocketServer>
#include <QFile>
#include <QJsonParseError>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonObject>
#include <QtCore/QTemporaryFile>
//#include <QtCore/QSaveFile>
#include <QtCore/QDateTime>
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtCore/QUrlQuery>
#include <QtCore/QDebug>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QTemporaryFile>
//#include <QSaveFile>
#include <QDateTime>
#include <QFileInfo>
#include <QDir>
#include <QUrlQuery>
#include <QDebug>
#define L QStringLiteral
@@ -57,7 +56,7 @@ LoggerFactory *ThpScriptServer::createLoggerFactory()
// Logger
Logger::Logger(LoggerFactory *loggerFactory, QObject *parent)
: httq::Logger(loggerFactory, parent)
.getNGLLogger(QString::fromUtf8(parent->metaObject()->className()).replace(QStringLiteral("::"), QStringLiteral(".")).toStdString())) // man man
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(QString::fromUtf8(parent->metaObject()->className()).replace(QStringLiteral("::"), QStringLiteral(".")).toStdString())) // man man
{}
@@ -83,6 +82,7 @@ void Logger::error(const QString &message)
ThpScriptServer::ThpScriptServer(QObject *parent)
: AbstractServer(parent)
, mWsSvr(new QWebSocketServer({}, QWebSocketServer::NonSecureMode, this))
, m_logger(getLogger("ThpScriptServer"))
{
if (!listen(NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER)))
{
@@ -348,7 +348,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
QVector<ThpServerInformation> tsiArray;
tsiArray.reserve(arr.size() + 1);
for (const QJsonValue &val : std::as_const(arr))
for (const QJsonValue &val : qAsConst(arr))
{
ThpServerInformation tsix(fromJson(val));
if (tsix.scriptId == tsi.scriptId && tsix.exerciseId == tsi.exerciseId)
@@ -52,8 +52,7 @@ public:
void error(const QString &message) override;
private:
NGL::INGLLogger &m_logger;
NGL::INGLLogger &m_logger;
};
@@ -77,6 +76,8 @@ public :
private:
QWebSocketServer *mWsSvr;
NGL::INGLLogger &m_logger;
static QJsonObject noError();
bool newHttpConnection(httq::HttpRequest *request) override;
virtual QWebSocketServer *webSocketServer() const override { return mWsSvr; }