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

@@ -2,7 +2,7 @@
* @RDE_HEADER@
* The FiringUnitValidator regulates the rules for firing units
* $Id: participant_dis_helper.h 37747 2017-12-08 08:07:01Z ehrlicher $
* $HeadURL: svn://10.196.0.54/TDS/branches/product/features/24_vulcano/Lts/ParticipantManagement/Gui/Common/participant_dis_helper.h $
* $HeadURL: svn://10.196.0.54/TDS/branches/product/features/24_vulcano/Lts/Plugins/ParticipantManagement/Gui/Common/participant_dis_helper.h $
* $Author: ehrlicher $
* Created by Hannes Fritsche, ESZS, 2024-03-07
*/
@@ -2,16 +2,16 @@
* @RDE_HEADER@
* The FiringUnitValidator regulates the rules for firing units serverside
* $Id: participant_dis_helper.h 37747 2017-12-08 08:07:01Z ehrlicher $
* $HeadURL: svn://10.196.0.54/TDS/branches/product/features/24_vulcano/Lts/ParticipantManagement/Gui/Common/participant_dis_helper.h $
* $HeadURL: svn://10.196.0.54/TDS/branches/product/features/24_vulcano/Lts/Plugins/ParticipantManagement/Gui/Common/participant_dis_helper.h $
* $Author: ehrlicher $
* Created by Hannes Fritsche, ESZS, 2024-03-07
*/
#pragma once
#include <QtCore/QObject>
#include <QObject>
#include <memory>
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
namespace ParticipantManagement
{
@@ -19,6 +19,7 @@ namespace ParticipantManagement
GetParticipants::GetParticipants(MainHandler *mainHandler)
: Interface::Fts::GetParticipantsRequestHandler(mainHandler->fts())
, m_mainHandler(mainHandler)
, m_logger(getLogger("GetParticipants"))
{}
GetParticipants::~GetParticipants()
@@ -21,12 +21,12 @@ public:
~GetParticipants();
private:
NGL::INGLLogger &m_logger;
void onGetParticipantsRequest(const rti::core::SampleIdentity &cookie,
const GetParticipantsRequest &request) override;
private:
NGL::INGLLogger &m_logger;
MainHandler *m_mainHandler;
NGL::INGLLogger &m_logger;
};
}
@@ -13,7 +13,7 @@
#include <ParticipantManagement/web_socket_handler.h>
#include <QtCore/QSet>
#include <QSet>
namespace ParticipantManagement
{
@@ -12,7 +12,7 @@
#include <ParticipantManagement/ppm.hpp>
#include <TrainingAreaBase/tab.hpp>
#include <QtCore/QMutex>
#include <QMutex>
namespace ParticipantManagement
{
@@ -7,7 +7,6 @@
* Created by Hannes Baeuerle, SLSE, 2016-05-12
*/
#include "participant_handler.h"
#include <utility>
#include "participant.h"
#include "ppm_common.h"
@@ -17,7 +16,7 @@
#include <Buildings/bld.hpp>
#include <ProjectDataManagement/pdm_dtc.h>
#include <LtsUtils/LtsUtilsCore/outdated_position.h>
#include <LtsUtilsCore/outdated_position.h>
namespace ParticipantManagement
{
@@ -44,7 +43,7 @@ void ParticipantHandler::clearParticipants()
dts()->removeHitLineInfoByKey(it.value().id());
m_hitLineInfoMap.clear();
for (auto p : std::as_const(m_participants))
for (auto p : qAsConst(m_participants))
{
p->removeFromDds();
delete p;
@@ -346,7 +345,7 @@ void ParticipantHandler::onNewParticipantModeReport(const TrainingAreaBase::Part
Participant *participant = participantByEquipmentNumber(report.equipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << report.equipmentNumber();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << report.equipmentNumber();
return;
}
@@ -388,7 +387,7 @@ void ParticipantHandler::onNewSpecialSensorData(const TrainingAreaBase::SpecialS
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
@@ -416,7 +415,7 @@ void ParticipantHandler::onNewLaserDesignation(const TrainingAreaBase::LaserDesi
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
@@ -440,7 +439,7 @@ void ParticipantHandler::onLaserDesignationRemoved(int equipmentNumber, int gear
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << equipmentNumber;
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << equipmentNumber;
return;
}
DynamicParticipantData dpd = participant->dynamicParticipantData();
@@ -467,7 +466,7 @@ void ParticipantHandler::onBuildingHitLineInfo(const Buildings::BuildingHitLineI
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with participantId: " << data.originatorParticipantId();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with participantId: " << data.originatorParticipantId();
return;
}
@@ -490,7 +489,7 @@ void ParticipantHandler::onSanitaryMaterialStockReport(const TrainingAreaBase::P
Participant *participant = participantByEquipmentNumber(data.equipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
if (data.qualification() == TrainingAreaBase::Qualification::NotDefined)
@@ -524,7 +523,7 @@ void ParticipantHandler::onParticipantSanitation(const TrainingAreaBase::Partici
Participant *participantOrig = participantByEquipmentNumber(data.originatorEquipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
int participantOrigId = data.originatorEquipmentNumber();
@@ -555,7 +554,7 @@ void ParticipantHandler::onOperatorAction(const TrainingAreaBase::OperatorAction
Participant *participant = participantByEquipmentNumber(data.equipmentNumber());
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
@@ -586,7 +585,7 @@ void ParticipantHandler::onNewFunctionalAreaEntryChanged(const TrainingAreaBase:
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with equipment number " << data.equipmentNumber();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with equipment number " << data.equipmentNumber();
return;
}
@@ -640,7 +639,7 @@ void ParticipantHandler::setPosition(const ParticipantManagement::ParticipantPos
if (!participant)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not find participant with id " << data.participantId();
ERROR_LOG(m_logger) << LOGFUNCTION << "Could not find participant with id " << data.participantId();
return;
}
@@ -135,7 +135,6 @@ class ParticipantHandler
quint16 getWebSocketPort() const;
protected:
NGL::INGLLogger &m_logger;
static void updateLaserDesignation(DynamicParticipantData &data, const TrainingAreaBase::LaserDesignation &newLaserDesignation);
void updateLaserDesignation(DynamicParticipantData &dataInOut, const Buildings::BuildingHitLineInfo &newLaserDesignation);
static void removeLaserDesignation(DynamicParticipantData &data, qint32 gearId);
@@ -159,7 +158,6 @@ class ParticipantHandler
virtual bool isSampleTimeInFuture(qint64 sampleTime) const;
protected:
NGL::INGLLogger &m_logger;
std::unique_ptr<UnitPositionCalculator> m_unitPositionCalculator;
QHash<int, int> m_equipNumber2ParticipantId;
QHash<int, Participant *> m_participants;
@@ -168,6 +166,8 @@ class ParticipantHandler
QMap<int, HitLineInfo> m_hitLineInfoMap;
BaseDataProvider *m_bdp;
LOGGER_T m_logger;
std::shared_ptr<WebSocketHandler> m_webSocketHandler;
friend class Participant;
@@ -7,7 +7,6 @@
* Created by Hannes Baeuerle, SLSE, 2016-05-12
*/
#include "participant_handler_for_exercise.h"
#include <utility>
#include "convert_db_to_dds.h"
#include "firing_unit_validator.h"
@@ -22,11 +21,11 @@
#include <ParticipantManagement/ppm_record_replay_plugin.h>
#include <ngldb/dbtransaction.h>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QtCore/QTimer>
#include <QtCore/QVector>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QTimer>
#include <QVector>
#include <QtGui/QTransform>
namespace ParticipantManagement
@@ -169,7 +168,7 @@ bool ParticipantHandlerForExercise::init()
}
// remove the 'unused' EquipmentExerciseMappings (for whatever reason there are some...)
for (const auto &eem : std::as_const(localEquipmentExerciseMappings))
for (const auto &eem : qAsConst(localEquipmentExerciseMappings))
dbEx0->removeEquipmentExerciseMapping(eem);
// after m_publishEquipmentExerciseMappings has been set and participants are created
@@ -190,7 +189,7 @@ bool ParticipantHandlerForExercise::init()
bool isOwnPositionParticipant = false;
// publish participants in dds
for (Participant *p : std::as_const(m_participants))
for (Participant *p : qAsConst(m_participants))
{
if (p->equipmentNumber() == 1)
isOwnPositionParticipant = true;
@@ -310,7 +309,7 @@ bool ParticipantHandlerForExercise::init()
dtc->equipmentExerciseMappings([this](const EquipmentExerciseMapping &data) { onEquipmentExerciseMappingChanged(data, DataModification::eAdded); });
auto pub = dts();
for (const ParticipantOrganisation &partOrga : std::as_const(m_participantOrganisations))
for (const ParticipantOrganisation &partOrga : qAsConst(m_participantOrganisations))
pub->publish(partOrga);
if (m_mainHandler->exerciseId() > 0)
@@ -352,7 +351,7 @@ bool ParticipantHandlerForExercise::init()
m_pdmDtc->waitForHistoricalDataGearTypeChargeType();
}
// for(const auto &participant : std::as_const(m_participants))
// for(const auto &participant : qAsConst(m_participants))
// customedSetGearCharges(participant);
return true;
@@ -455,7 +454,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::modifyParticipantDataRe
checkLongActionBreak();
for (const ParticipantManagement::ParticipantData &currentParticipant : std::as_const(validateData.participantsToBeCreatedOrModified))
for (const ParticipantManagement::ParticipantData &currentParticipant : qAsConst(validateData.participantsToBeCreatedOrModified))
{
auto ret = validateParticipantData(validateData, currentParticipant);
if (ret.error())
@@ -597,7 +596,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::modifyParticipantDataRe
DEBUG_LOG(m_logger) << "New participants created and existing participants updated";
// build hierarchy
for (const ParticipantData &currentData : std::as_const(validateData.participantsToBeCreatedOrModified)) // first set superiorIds
for (const ParticipantData &currentData : qAsConst(validateData.participantsToBeCreatedOrModified)) // first set superiorIds
{
Participant *participantToUpdate = participantById(validateData.modIdToParticipantId.value(currentData.modId()));
if (currentData.superiorModId() >= 0) // superiorModId < 0 -> no change in superior
@@ -613,7 +612,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::modifyParticipantDataRe
QHash<int, std::vector<int32_t>> inferiors;
inferiors.reserve(m_participants.size() / 2);
// first collect all inferiors per superior
for (const Participant *currentParticipant : std::as_const(m_participants))
for (const Participant *currentParticipant : qAsConst(m_participants))
{
int superiorId = currentParticipant->superiorId();
inferiors[superiorId].push_back(currentParticipant->id());
@@ -626,7 +625,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::modifyParticipantDataRe
}
}
// now update all participants with newly collected inferiors
for (Participant *currentParticipant : std::as_const(m_participants))
for (Participant *currentParticipant : qAsConst(m_participants))
{
if (currentParticipant->hasNewInferiorStructure(inferiors.value(currentParticipant->id())))
participantsWithChanges.insert(currentParticipant);
@@ -636,7 +635,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::modifyParticipantDataRe
// update in Database
std::vector<Database::PpmParticipant> dbParticipantsToUpdate;
dbParticipantsToUpdate.reserve(participantsWithChanges.size());
for (Participant *currentParticipant : std::as_const(participantsWithChanges))
for (Participant *currentParticipant : qAsConst(participantsWithChanges))
{
dbParticipantsToUpdate.push_back(currentParticipant->toDbParticipant());
partiesUsed.insert(currentParticipant->partyId());
@@ -652,13 +651,13 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::modifyParticipantDataRe
// mark parties in use
ChangePartyUsedStateRequest req;
for (int partyId : std::as_const(partiesUsed))
for (int partyId : qAsConst(partiesUsed))
{
req.partyId(partyId);
req.isUsedBy(true);
m_mainHandler->partyHandler()->changePartyUsedStateRequest(req);
}
for (int partyId : std::as_const(partiesWithDeletedOrMovedOutParticipants))
for (int partyId : qAsConst(partiesWithDeletedOrMovedOutParticipants))
{
req.partyId(partyId);
req.isUsedBy(false);
@@ -727,7 +726,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::modifyParticipantDataRe
QJsonArray jsonArray;
// finally ... publish participant data via dds if no error occured
for (Participant *currentParticipant : std::as_const(participantsWithChanges))
for (Participant *currentParticipant : qAsConst(participantsWithChanges))
{
currentParticipant->publishParticipant();
NOTICE_LOG(m_logger) << "publishParticipant id=" << currentParticipant->id();
@@ -1293,7 +1292,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::selectiveReammunitionRe
tabRequest.participantId(request.id());
tabRequest.gearId(request.gearId());
INFO_LOG(m_logger) << "Gear id = " << request.gearId();
for (const Reammunition ra : std::as_const(request.reammunition()))
for (const Reammunition ra : qAsConst(request.reammunition()))
{
TrainingAreaBase::Reammunition tabRa;
tabRa.chargeTypeId(ra.chargeTypeId());
@@ -1368,7 +1367,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::setSimulatedPositionReq
{
if (request.participantId() <= 0)
{
for (Participant *participant : std::as_const(m_participants))
for (Participant *participant : qAsConst(m_participants))
{
if (participant->isDeleted() || participant->superiorId() != 0)
continue;
@@ -1508,7 +1507,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::validateParticipantData
DEBUG_LOG(m_logger) << "checking superiorIds";
// superior exists?
bool isExistingSuperiorId = false;
for (const ParticipantData &dat : std::as_const(data.participantsToBeCreatedOrModified))
for (const ParticipantData &dat : qAsConst(data.participantsToBeCreatedOrModified))
{
if (participantToValidate.superiorModId() == dat.modId())
{
@@ -1530,7 +1529,7 @@ Core::FunctionReplyObject ParticipantHandlerForExercise::validateParticipantData
// all hierarchy numbers with same superior unique?
DEBUG_LOG(m_logger) << "checking hierarchyNumbers";
for (const ParticipantData &dat : std::as_const(data.participantsToBeCreatedOrModified))
for (const ParticipantData &dat : qAsConst(data.participantsToBeCreatedOrModified))
{
// operator==() on optionals returns false if not set ...
if (dat.modId() != participantToValidate.modId() && dat.superiorModId() == participantToValidate.superiorModId()
@@ -1804,7 +1803,7 @@ void ParticipantHandlerForExercise::onEquipmentExerciseMappingChanged(const Equi
case DataModification::eModified:
{
QSet<int> oldEqIds;
for (const auto &db : std::as_const(m_equipmentExerciseMappings))
for (const auto &db : qAsConst(m_equipmentExerciseMappings))
{
if (db.exerciseId != data.exerciseId())
continue;
@@ -15,9 +15,9 @@
#include <QtCore/QMutex>
#include <QtCore/QString>
#include <QtCore/QJsonDocument>
#include <QJsonDocument>
#include <ExerciseManagement/exm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_fts.h>
#include <ProjectDataManagement/pdm_dtc.h>
#include <TrainingAreaBase/tab_dts.h>
@@ -18,6 +18,7 @@ namespace ParticipantHandling
ProxyListener::ProxyListener(MainHandler *mainHandler)
: QObject()
, m_mainHandler(mainHandler)
, m_logger(getLogger("ProxyListener"))
{}
bool ProxyListener::init()
@@ -9,24 +9,26 @@
#include "unit_position_calculator.h"
#include "participant_handler.h"
#include <QtCore/QTimer>
#include <QTimer>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h>
#include <LtsUtils/LtsUtilsCore/outdated_position.h>
#include <QtCore/QPointF>
#include <QtCore/QDateTime>
#include <LtsUtilsCore/qpoint3d.h>
#include <LtsUtilsCore/outdated_position.h>
#include <QPointF>
#include <QDateTime>
#include <QtConcurrent>
namespace ParticipantManagement
{
namespace ParticipantHandling
{
UnitPositionCalculator::UnitPositionCalculator(ParticipantHandler *participantHandler, QObject *parent) : QObject(parent)
UnitPositionCalculator::UnitPositionCalculator(ParticipantHandler *participantHandler, QObject *parent)
: QObject(parent)
, m_participantHandler(participantHandler)
, m_bSomethingChangedSinceLastCalculation(false)
, m_timer(new QTimer(this))
, m_bRunning(true),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
, m_bRunning(true)
, m_logger(getLogger("UnitPositionCalculator"))
{
connect(m_timer, &QTimer::timeout, this, &UnitPositionCalculator::calculate);
m_timer->setSingleShot(true);
@@ -7,8 +7,8 @@
*/
#pragma once
#include <QtCore/QObject>
#include <QtCore/QFutureWatcher>
#include <QObject>
#include <QFutureWatcher>
#include <Core/core.hpp>
#include <unordered_map>
#include "participant_handler.h"
@@ -36,7 +36,6 @@ public:
void onInferiorChanged(int participantId, const std::vector<int> &inferiorIds);
private:
NGL::INGLLogger &m_logger;
struct CalculatedUnitPosition : public ParticipantManagement::UnitPosition
{
int superiorId = 0;
@@ -44,7 +43,6 @@ private:
};
private:
NGL::INGLLogger &m_logger;
CalculatedUnitPosition &getParticipant(int participantId);
void calculate();
// no const ref - must be a copy since this is running in a different thread
@@ -63,7 +61,6 @@ private Q_SLOTS:
void onCalculationDone();
private:
NGL::INGLLogger &m_logger;
std::unordered_map<int, CalculatedUnitPosition> m_participantData;
std::unordered_map<int, CalculatedUnitPosition> m_publishedPositionData;
@@ -73,6 +70,7 @@ private:
bool m_bSomethingChangedSinceLastCalculation;
QTimer *m_timer;
bool m_bRunning;
NGL::INGLLogger &m_logger;
};
} // namespace ParticipantHandling