Qt6 migration fixes: RTI DDS alias targets, ErrorMessage namespace, DDS header include path

This commit is contained in:
torsten committed 2026-08-27 09:02:26 +02:00
1 parent 8050bca545
commit bb1447c858
18635 files changed
+2466913 -906310

No files matched your search

@@ -11,7 +11,7 @@ NGL_ADD_LIBRARY2(LtsCoordTrans WS AAR SV HLA SHARED
lts_coord_trans.cpp
)
NGL_TARGET_LINK_LIBRARIES(LtsCoordTrans
PRIVATE
PUBLIC
Qt6::Core
)
if (GeographicLib_FOUND)
@@ -22,7 +22,7 @@ NGL_TARGET_LINK_LIBRARIES(LtsCoordinate
PRIVATE
LtsCoordTrans
PUBLIC
ddscore
$<IF:$<TARGET_EXISTS:ddscore>,ddscore,>
LtsUtilsCoreHeaderOnly
Qt6::Core
)
@@ -3,8 +3,8 @@
#include "lts_elevation_manager.h"
#ifdef BUILD_RTI
#include <Plugins/AssetManagement/asm_data_plugin_interface.h>
#include <Plugins/ExerciseManagement/exm_data_plugin_interface.h>
#include <AssetManagement/asm_data_plugin_interface.h>
#include <ExerciseManagement/exm_data_plugin_interface.h>
#include <Viewer/SituationMap/ElevationMap/elevation_map_manager.h>
static_assert((int)SituationMap::ElevationMapManager::LineOfSight::LOS_UNDEFINED ==
@@ -1,8 +1,8 @@
#pragma once
#include <Plugins/AssetManagement/asm_data_plugin_interface.h>
#include <Plugins/OperatorManagement/opm_data_plugin_interface.h>
#include <Plugins/SituationReplayManagement/srm_data_plugin_interface.h>
#include <AssetManagement/asm_data_plugin_interface.h>
#include <OperatorManagement/opm_data_plugin_interface.h>
#include <SituationReplayManagement/srm_data_plugin_interface.h>
#include <QtCore/QObject>
#include <ltslogin_export.h>
@@ -930,7 +930,7 @@ void Base::printSinglePage()
m_tempdoc->setPageSize(contentRect(m_printer).size());
QTextFrameFormat fmt = m_tempdoc->rootFrame()->frameFormat();
fmt.setMargin(0);
fmt.setContentsMargins(0, 0, 0, 0);
m_tempdoc->rootFrame()->setFrameFormat(fmt);
int doccopies;
@@ -175,7 +175,7 @@ bool CTS::DisconnectRequest::hasValidData() const
return true;
}
ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
LtsProjectionWorkstation::ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
: Message(nullptr, nullptr, JsonKeys::ERROR_MESSAGE(), uuid, QJsonValue()), m_reason(reason)
{
QJsonObject result;
@@ -183,7 +183,7 @@ ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
m_replyData = result;
}
void ErrorMessage::process()
void LtsProjectionWorkstation::ErrorMessage::process()
{
if (!m_handler || !m_client)
return;
@@ -192,7 +192,7 @@ void ErrorMessage::process()
m_handler->handleMessage(this);
}
bool ErrorMessage::hasValidData() const
bool LtsProjectionWorkstation::ErrorMessage::hasValidData() const
{
if (!m_handler || !m_client)
return false;
@@ -63,7 +63,7 @@ void SelectHandler::mousePressEvent(QMouseEvent* event)
contextMenu->addSection(tr("All tracks"));
{
QAction* action = new QAction(tr("Set topic description"), tcw);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_D));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
action->setShortcutVisibleInContextMenu(true);
#endif
@@ -90,7 +90,7 @@ void SelectHandler::mousePressEvent(QMouseEvent* event)
{
QAction* action = new QAction(tr("Select all topics"), tcw);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_A));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
action->setShortcutVisibleInContextMenu(true);
#endif
@@ -102,7 +102,7 @@ void SelectHandler::mousePressEvent(QMouseEvent* event)
{
QAction* action = new QAction(tr("Cut selected topic(s)"), tcw);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_X));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
action->setShortcutVisibleInContextMenu(true);
#endif
@@ -113,7 +113,7 @@ void SelectHandler::mousePressEvent(QMouseEvent* event)
{
QAction* action = new QAction(tr("Copy selected topic(s)"), tcw);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_C));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
action->setShortcutVisibleInContextMenu(true);
#endif
@@ -124,7 +124,7 @@ void SelectHandler::mousePressEvent(QMouseEvent* event)
{
QAction* action = new QAction(tr("Paste topic(s) at indicator position"), tcw);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_V));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_V));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
action->setShortcutVisibleInContextMenu(true);
#endif
@@ -38,7 +38,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(LtsSessionDataDds
)
NGL_TARGET_LINK_LIBRARIES(LtsSessionDataDds
PRIVATE
$<$<BOOL:${BUILD_RTI}>:ddsconnector>
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddsconnector>,ddsconnector,>>
PUBLIC
$<$<BOOL:${BUILD_RTI}>:nddscore>
NGLLogger
@@ -22,10 +22,10 @@
#ifdef BUILD_RTI
#include <dds/domain/DomainParticipant.hpp>
#include "INGLLogger.h"
namespace DDSConnector { class DdsConnector; }
namespace DTC { template<typename T> class GenericDTCImpl; }
namespace Core { struct PartitionTime; }
namespace NGL { class INGLLogger; }
namespace DataPluginBase { class Interface; }
class Fetcher;
#else
@@ -137,10 +137,18 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> availableDataPluginInterfaces() const;
void addAvailablaeDataPluginInterfaces(const QMap<QString, std::shared_ptr<DataPluginBase::Interface>>& dataPlugins);
#else
// Stub returns empty map - void* doesn't work well in QMap template
QMap<QString, void*> availableDataPluginInterfaces() const { return QMap<QString, void*>(); }
void addAvailablaeDataPluginInterfaces(const QMap<QString, void*>& /*dataPlugins*/) {}
#endif
// retrieve DTC/FTC inside DataPlugin::createDataInterface() - always available
template<typename T>
bool createTopicClient(std::shared_ptr<T> &member, bool bEnableAll = false, bool bGlobal = false);
template<typename T, typename S>
bool createTopicClient(std::shared_ptr<T> &dtc, std::shared_ptr<S> &ftc, bool bEnableAll = false, bool bGlobal = false);
template<typename T, typename S>
bool getDtc(std::shared_ptr<S> &val) const;
signals:
void partitionTimeChanged(qint64 newPartitionTime);
@@ -161,6 +169,7 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorGlobal;
std::shared_ptr<DTC::GenericDTCImpl<Core::PartitionTime>> m_dtcPartitionTime;
NGL::INGLLogger& m_logger;
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> m_dataPluginInterfaces;
#else
// Stub implementation - minimal members
bool initInternal();
@@ -175,3 +184,74 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
};
} // namespace LtsSession
// Template method implementations - must be in header
#ifdef BUILD_RTI
template<typename T>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &member, bool bEnableAll, bool bGlobal)
{
member = T::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
if ( bEnableAll && !member->enableAll())
{
member = nullptr;
if (m_logger.isErrorEnabled())
NGL::LogStreamHelper(m_logger, NGL::LogLevel::Error, __FILE__, __LINE__, Q_FUNC_INFO) << "Error initializing dtc/ftc for service " << T::identifier();
return false;
}
return true;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &dtc, std::shared_ptr<S> &ftc, bool bEnableAll, bool bGlobal)
{
dtc = T::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
ftc = S::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
if ( (bEnableAll && !dtc->enableAll()) || !ftc->enableAll())
{
dtc = nullptr;
ftc = nullptr;
if (m_logger.isErrorEnabled())
NGL::LogStreamHelper(m_logger, NGL::LogLevel::Error, __FILE__, __LINE__, Q_FUNC_INFO) << "Error initializing dtc/ftc for service " << T::identifier();
return false;
}
return true;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::getDtc(std::shared_ptr<S> &val) const
{
for (const auto &i : m_dataPluginInterfaces)
{
auto ifc = std::dynamic_pointer_cast<T>(i);
if (ifc)
{
val = ifc->getDtc();
return val != nullptr;
}
}
val.reset();
if (m_logger.isDebugEnabled())
NGL::LogStreamHelper(m_logger, NGL::LogLevel::Debug, __FILE__, __LINE__, Q_FUNC_INFO) << "Trying to load dtc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
return false;
}
#else
// Stub implementations for non-BUILD_RTI
template<typename T>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &/*member*/, bool /*bEnableAll*/, bool /*bGlobal*/)
{
return false;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &/*dtc*/, std::shared_ptr<S> &/*ftc*/, bool /*bEnableAll*/, bool /*bGlobal*/)
{
return false;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::getDtc(std::shared_ptr<S> &/*val*/) const
{
return false;
}
#endif // BUILD_RTI
@@ -4,7 +4,7 @@
#include <LtsSession/lts_session.h>
#include <QtGui/QPainter>
#include <QPainterPath>
#include <QtGui/QPainterPath>
#include <QtCore/QRect>
#include <time.h>
@@ -6,7 +6,7 @@
#include <QtGui/QGuiApplication>
#include <QtGui/QPainter>
#include <QPainterPath>
#include <QtGui/QPainterPath>
#include <QtGui/QPen>
#include <QtCore/QPoint>
#include <QtCore/QRect>
@@ -7,8 +7,8 @@
#include <QtCore/QDebug>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QVBoxLayout>
#include <Services/ProjectDataManagement/pdm_enums.hpp>
#include <Services/ProjectDataManagement/pdm_translation.h>
#include <ProjectDataManagement/pdm_enums.hpp>
#include <ProjectDataManagement/pdm_translation.h>
#include <nglapplication/nglapplication.h>
#include <time.h>
@@ -5,7 +5,7 @@
#include <LtsAppManager/lts_app_manager.h>
#include <QtWidgets/QApplication>
#include <QtGui/QClipboard>
#include <QDoubleSpinBox>
#include <QtWidgets/QDoubleSpinBox>
#include <QtWidgets/QHBoxLayout>
#include <QtGui/QKeyEvent>
#include <QtWidgets/QLineEdit>
@@ -6,7 +6,7 @@
#include "ltswebsocketserver_export.h"
#include <QtCore/QObject>
#include <QQueue>
#include <QtCore/QQueue>
#include <QtCore/QObject>
#include <memory>
@@ -287,6 +287,9 @@ protected:
return -1;
}
// Protected accessor for derived/proxy models
const QVector<T>& getDataVector() const { return m_vecData; }
QVector<T> m_vecData;
QVector<QString> m_vecColumns;
};
@@ -10,7 +10,7 @@
#pragma once
#include <QtWidgets/QWidget>
#include <QDoubleSpinBox>
#include <QtWidgets/QDoubleSpinBox>
#include <QtCore/QSet>
#include <LtsWidgets/lts_widgets_export.h>
@@ -63,7 +63,8 @@ void LtsColumnFilterProxyModel::setColumnStringFilter(const QString &newFilterSt
it.value() = rx;
}
}
invalidateFilter();
beginFilterChange();
endFilterChange();
}
void LtsColumnFilterProxyModel::setColumnDataFilter(const QVariant &newFilterData, int column)
@@ -90,7 +91,8 @@ void LtsColumnFilterProxyModel::setColumnDataFilter(const QVariant &newFilterDat
it.value() = newFilterData;
}
}
invalidateFilter();
beginFilterChange();
endFilterChange();
}
@@ -138,7 +140,8 @@ void LtsColumnFilterProxyModel::setRecursiveFilteringEnabled(bool recursive)
if (m_bRecursiveFiltering == recursive)
return;
m_bRecursiveFiltering = recursive;
invalidateFilter();
beginFilterChange();
endFilterChange();
}
bool LtsColumnFilterProxyModel::recursiveFilteringEnabled() const
@@ -20,14 +20,14 @@
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QCompleter>
#include <QtWidgets/QCompleter>
#include <QtCore/QDateTime>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHBoxLayout>
#include <QtGui/QKeyEvent>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QRegularExpressionValidator>
#include <QtGui/QRegularExpressionValidator>
#include <QtGui/QShortcut>
#include <QtWidgets/QSlider>
#include <QtWidgets/QToolButton>
@@ -20,14 +20,14 @@
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QCompleter>
#include <QtWidgets/QCompleter>
#include <QtCore/QDateTime>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHBoxLayout>
#include <QtGui/QKeyEvent>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QRegularExpressionValidator>
#include <QtGui/QRegularExpressionValidator>
#include <QtGui/QShortcut>
#include <QtWidgets/QSlider>
#include <QtWidgets/QToolButton>
@@ -10,9 +10,9 @@
#include "lts_height_plot_widget.h"
#include <QtGui/QPainter>
#include <QPainterPath>
#include <QtGui/QPainterPath>
#include <QtGui/QPen>
#include <QTransform>
#include <QtGui/QTransform>
#include <QtGui/QMouseEvent>
#include <cmath>
@@ -2,7 +2,7 @@
#include "lts_widgets_export.h"
#include <QtWidgets/QWidget>
#include <QPainterPath>
#include <QtGui/QPainterPath>
class QPaintEvent;
@@ -11,7 +11,7 @@
#include "lts_profile_button.h"
#include <QtGui/QPainter>
#include <QPainterPath>
#include <QtGui/QPainterPath>
#include <QtGui/QPaintEvent>
#include <QtGui/QBrush>
#include <QtGui/QPen>
@@ -223,14 +223,14 @@ void LtsTextEditor2::setupFileActions()
const QIcon exportPdfIcon = QIcon::fromTheme(QStringLiteral("exportpdf"), QIcon(rsrcPath()+ QStringLiteral("/exportpdf.png")));
actionExport = menu->addAction(exportPdfIcon, tr("&Export PDF..."), this, &LtsTextEditor2::filePrintPdf);
actionExport->setPriority(QAction::LowPriority);
actionExport->setShortcut(Qt::CTRL + Qt::Key_D);
actionExport->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_D));
tb->addAction(actionExport);
menu->addSeparator();
#endif
m_actionQuit = menu->addAction(tr("&Quit"), this, &QWidget::close);
m_actionQuit->setShortcut(Qt::CTRL + Qt::Key_Q);
m_actionQuit->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_Q));
}
void LtsTextEditor2::setupEditActions()
@@ -281,7 +281,7 @@ void LtsTextEditor2::setupTextActions()
const QIcon boldIcon = QIcon::fromTheme(QStringLiteral(":icons/22x22/format-text-bold.png"));
m_actionTextBold = menu->addAction(boldIcon, tr("&Bold"), this, &LtsTextEditor2::onTextBold);
m_actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B);
m_actionTextBold->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_B));
m_actionTextBold->setPriority(QAction::LowPriority);
QFont bold;
bold.setBold(true);
@@ -292,7 +292,7 @@ void LtsTextEditor2::setupTextActions()
const QIcon italicIcon = QIcon::fromTheme(QStringLiteral(":icons/22x22/format-text-italic.png"));
m_actionTextItalic = menu->addAction(italicIcon, tr("&Italic"), this, &LtsTextEditor2::onTextItalic);
m_actionTextItalic->setPriority(QAction::LowPriority);
m_actionTextItalic->setShortcut(Qt::CTRL + Qt::Key_I);
m_actionTextItalic->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_I));
QFont italic;
italic.setItalic(true);
m_actionTextItalic->setFont(italic);
@@ -301,7 +301,7 @@ void LtsTextEditor2::setupTextActions()
const QIcon underlineIcon = QIcon::fromTheme(QStringLiteral(":icons/22x22/format-text-underline.png"));
m_actionTextUnderline = menu->addAction(underlineIcon, tr("&Underline"), this, &LtsTextEditor2::onTextUnderline);
m_actionTextUnderline->setShortcut(Qt::CTRL + Qt::Key_U);
m_actionTextUnderline->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_U));
m_actionTextUnderline->setPriority(QAction::LowPriority);
QFont underline;
underline.setUnderline(true);
@@ -313,31 +313,31 @@ void LtsTextEditor2::setupTextActions()
const QIcon leftIcon = QIcon::fromTheme(QStringLiteral(":icons/22x22/format-justify-left.png"));
m_actionAlignLeft = new QAction(leftIcon, tr("&Left"), this);
m_actionAlignLeft->setShortcut(Qt::CTRL + Qt::Key_L);
m_actionAlignLeft->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_L));
m_actionAlignLeft->setCheckable(true);
m_actionAlignLeft->setPriority(QAction::LowPriority);
const QIcon centerIcon = QIcon::fromTheme(QStringLiteral(":icons/22x22/format-justify-center.png"));
m_actionAlignCenter = new QAction(centerIcon, tr("C&enter"), this);
m_actionAlignCenter->setShortcut(Qt::CTRL + Qt::Key_E);
m_actionAlignCenter->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_E));
m_actionAlignCenter->setCheckable(true);
m_actionAlignCenter->setPriority(QAction::LowPriority);
const QIcon rightIcon = QIcon::fromTheme(QStringLiteral(":icons/22x22/format-justify-right.png"));
m_actionAlignRight = new QAction(rightIcon, tr("&Right"), this);
m_actionAlignRight->setShortcut(Qt::CTRL + Qt::Key_R);
m_actionAlignRight->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_R));
m_actionAlignRight->setCheckable(true);
m_actionAlignRight->setPriority(QAction::LowPriority);
const QIcon fillIcon = QIcon::fromTheme(QStringLiteral(":icons/22x22/format-justify-fill.png"));
m_actionAlignJustify = new QAction(fillIcon, tr("&Justify"), this);
m_actionAlignJustify->setShortcut(Qt::CTRL + Qt::Key_J);
m_actionAlignJustify->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_J));
m_actionAlignJustify->setCheckable(true);
m_actionAlignJustify->setPriority(QAction::LowPriority);
const QIcon indentMoreIcon = QIcon::fromTheme(QStringLiteral("format-indent-more"), QIcon(rsrcPath()+ QStringLiteral("/format-indent-more.png")));
m_actionIndentMore = menu->addAction(indentMoreIcon, tr("&Indent"), this, &LtsTextEditor2::indent);
m_actionIndentMore->setShortcut(Qt::CTRL + Qt::Key_BracketRight);
m_actionIndentMore->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_BracketRight));
m_actionIndentMore->setPriority(QAction::LowPriority);
const QIcon indentLessIcon = QIcon::fromTheme(QStringLiteral("format-indent-less"), QIcon(rsrcPath()+ QStringLiteral("/format-indent-less.png")));
m_actionIndentLess = menu->addAction(indentLessIcon, tr("&Unindent"), this, &LtsTextEditor2::unindent);
m_actionIndentLess->setShortcut(Qt::CTRL + Qt::Key_BracketLeft);
m_actionIndentLess->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_BracketLeft));
m_actionIndentLess->setPriority(QAction::LowPriority);
// Make sure the alignLeft is always left of the alignRight
@@ -381,7 +381,7 @@ void LtsTextEditor2::setupTextActions()
const QIcon checkboxIcon = QIcon::fromTheme(QStringLiteral("status-checkbox-checked"), QIcon(rsrcPath()+ QStringLiteral("/checkbox-checked.png")));
m_actionToggleCheckState = menu->addAction(checkboxIcon, tr("Chec&ked"), this, &LtsTextEditor2::setChecked);
m_actionToggleCheckState->setShortcut(Qt::CTRL + Qt::Key_K);
m_actionToggleCheckState->setShortcut(QKeyCombination(Qt::CTRL, Qt::Key_K));
m_actionToggleCheckState->setCheckable(true);
m_actionToggleCheckState->setPriority(QAction::LowPriority);
tb->addAction(m_actionToggleCheckState);