Qt6 migration: LtsWidgets API fixes, LtsWebSocket logger init, RTI Docker install

- LtsWidgets: Fixed Qt6 API compatibility issues
  - QWheelEvent::delta() → angleDelta().y()
  - QStyleOption::init() → initFrom()
  - QComboBox activated signal signature change
  - QTextCodec removal (UTF-8 default in Qt6)
  - Missing widget includes added

- LtsWebSocket: Fixed m_logger reference initialization
  - Added NGLLoggerBootstrap includes
  - Proper initialization in constructor initializer lists

- CMake: Added BUILD_LTSWEBSOCKET option for temporary exclusion

- Docker: RTI Connext permanent installation script added
  - ci/install-rti-in-docker.sh for persistent RTI setup
  - Removes need for volume mounting RTI into container

- BUILD options: FilterManagement, RTI, Codification, Grantlee, LtsWebSocket
  can be disabled for partial builds during migration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 14:04:26 +02:00
1 parent 3bb6e89496
commit bafed3705f
69 files changed
+12765 -14202

No files matched your search

+246 -286
View File
@@ -1,385 +1,345 @@
#include "lts_tool_bar_area.h"
#include <utility>
#include "ui_lts_tool_bar_area.h"
#include "lts_drag_icon.h"
#include "ui_lts_tool_bar_area.h"
#include <LtsUtilsSettings/settings.h>
#include <QDebug>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QLabel>
#include <QDebug>
#include <QMenu>
#include <QShortcut>
#include <QPointer>
#include <QShortcut>
#include <QVariant>
#include <utility>
namespace LtsWidgets
{
void ShortCut::clear()
{
name.clear();
identifier.clear();
icon = nullptr;
shortcut->disconnect(icon);
name.clear();
identifier.clear();
icon = nullptr;
shortcut->disconnect(icon);
}
LtsToolBarArea::LtsToolBarArea(QWidget *parent)
: QWidget(parent)
, m_dummyLabel(nullptr)
, m_ui(new Ui::LtsToolBarArea)
LtsToolBarArea::LtsToolBarArea(QWidget* parent) : QWidget(parent), m_dummyLabel(nullptr), m_ui(new Ui::LtsToolBarArea)
{
m_ui->setupUi(this);
m_ui->setupUi(this);
setAcceptDrops(true);
clearToolBarArea();
setAcceptDrops(true);
clearToolBarArea();
for(int i=Qt::Key_F5; i<=Qt::Key_F12; ++i)
{
ShortCut sc(this);
sc.shortcut->setKey(QKeySequence(i));
sc.key = i;
m_functionKeys.insert(i, sc);
}
for (int i = Qt::Key_F5; i <= Qt::Key_F12; ++i)
{
ShortCut sc(this);
sc.shortcut->setKey(QKeySequence(i));
sc.key = i;
m_functionKeys.insert(i, sc);
}
}
LtsToolBarArea::~LtsToolBarArea()
{
delete m_ui;
delete m_ui;
}
void LtsToolBarArea::addMenuEntry(LtsDragIcon *entry, LtsDragIcon *after)
void LtsToolBarArea::addMenuEntry(LtsDragIcon* entry, LtsDragIcon* after)
{
if (!entry)
return;
if (m_foreignButtonMap.contains(entry))
return;
delete m_dummyLabel;
m_dummyLabel = nullptr;
bool isInternalMove = false;
LtsDragIcon *foreignDragIcon = entry;
for (int i = 0; i < m_buttonMap.size(); ++i)
{
if (m_buttonMap.at(i) == entry)
{
isInternalMove = true;
if (after == nullptr)
if (!entry)
return;
m_buttonMap.removeAt(i);
foreignDragIcon = m_foreignButtonMap.at(i);
m_foreignButtonMap.removeAt(i);
m_ui->layToolbar->removeWidget(entry);
break;
}
}
int index = m_buttonMap.size();
for(int i = 0; i < m_buttonMap.size(); ++i)
{
if (m_buttonMap.at(i) == after ||
m_foreignButtonMap.at(i) == after)
if (m_foreignButtonMap.contains(entry))
return;
delete m_dummyLabel;
m_dummyLabel = nullptr;
bool isInternalMove = false;
LtsDragIcon* foreignDragIcon = entry;
for (int i = 0; i < m_buttonMap.size(); ++i)
{
index = i + 1;
break;
if (m_buttonMap.at(i) == entry)
{
isInternalMove = true;
if (after == nullptr)
return;
m_buttonMap.removeAt(i);
foreignDragIcon = m_foreignButtonMap.at(i);
m_foreignButtonMap.removeAt(i);
m_ui->layToolbar->removeWidget(entry);
break;
}
}
}
LtsDragIcon *newAction = entry;
int index = m_buttonMap.size();
for (int i = 0; i < m_buttonMap.size(); ++i)
{
if (m_buttonMap.at(i) == after || m_foreignButtonMap.at(i) == after)
{
index = i + 1;
break;
}
}
if (!isInternalMove)
{
newAction = new LtsDragIcon(this);
newAction->setIcon(entry->icon());
newAction->setText(entry->text());
newAction->setContext(entry->context());
if (!entry->toolTip().isEmpty())
newAction->setToolTip(entry->toolTip());
newAction->setIconSize(ButtonSize::eDefault);
newAction->setButtonStyle(ButtonStyle::eIconOnly);
newAction->setIdentifier(entry->identifier());
LtsDragIcon* newAction = entry;
connect(newAction, &LtsDragIcon::clicked, entry, &LtsDragIcon::clicked);
connect(entry, &LtsDragIcon::destroyed, newAction,
[this, newAction]() { m_buttonMap.removeAll(newAction); newAction->deleteLater(); });
newAction->setVisible(!entry->text().isEmpty());
}
newAction->setContextMenuPolicy(Qt::CustomContextMenu);
connect(newAction, &LtsDragIcon::customContextMenuRequested,
this, &LtsToolBarArea::showContextMenu);
if (!isInternalMove)
{
newAction = new LtsDragIcon(this);
newAction->setIcon(entry->icon());
newAction->setText(entry->text());
newAction->setContext(entry->context());
if (!entry->toolTip().isEmpty())
newAction->setToolTip(entry->toolTip());
newAction->setIconSize(ButtonSize::eDefault);
newAction->setButtonStyle(ButtonStyle::eIconOnly);
newAction->setIdentifier(entry->identifier());
m_foreignButtonMap.insert(index, foreignDragIcon);
m_buttonMap.insert(index, newAction);
connect(newAction, &LtsDragIcon::clicked, entry, &LtsDragIcon::clicked);
connect(entry, &LtsDragIcon::destroyed, newAction, [this, newAction]() {
m_buttonMap.removeAll(newAction);
newAction->deleteLater();
});
newAction->setVisible(!entry->text().isEmpty());
}
newAction->setContextMenuPolicy(Qt::CustomContextMenu);
connect(newAction, &LtsDragIcon::customContextMenuRequested, this, &LtsToolBarArea::showContextMenu);
connect(foreignDragIcon, &LtsDragIcon::enabledChanged, newAction, &LtsDragIcon::setEnabled);
m_foreignButtonMap.insert(index, foreignDragIcon);
m_buttonMap.insert(index, newAction);
m_ui->layToolbar->insertWidget(index + 1, newAction);
saveSettings();
connect(foreignDragIcon, &LtsDragIcon::enabledChanged, newAction, &LtsDragIcon::setEnabled);
m_ui->layToolbar->insertWidget(index + 1, newAction);
saveSettings();
}
void LtsToolBarArea::clearToolBarArea()
{
qDeleteAll(m_buttonMap);
m_buttonMap.clear();
m_foreignButtonMap.clear();
for(ShortCut &item : m_functionKeys)
item.clear();
qDeleteAll(m_buttonMap);
m_buttonMap.clear();
m_foreignButtonMap.clear();
for (ShortCut& item : m_functionKeys)
item.clear();
delete m_dummyLabel;
m_dummyLabel = new QLabel(tr("Drop menu entry here"), this);
m_ui->layToolbar->addWidget(m_dummyLabel);
delete m_dummyLabel;
m_dummyLabel = new QLabel(tr("Drop menu entry here"), this);
m_ui->layToolbar->addWidget(m_dummyLabel);
}
void LtsToolBarArea::setMenuEntries(const QVector<LtsDragIcon *> &actions)
void LtsToolBarArea::setMenuEntries(const QVector<LtsDragIcon*>& actions)
{
clearToolBarArea();
clearToolBarArea();
for (LtsDragIcon* ico : actions)
addMenuEntry(ico);
for (LtsDragIcon* ico : actions)
addMenuEntry(ico);
}
QStringList LtsToolBarArea::menuEntries() const
{
QStringList ret;
ret.reserve(m_foreignButtonMap.size());
for (LtsDragIcon *dragIcon : m_foreignButtonMap)
ret << dragIcon->identifier();
QStringList ret;
ret.reserve(m_foreignButtonMap.size());
for (LtsDragIcon* dragIcon : m_foreignButtonMap)
ret << dragIcon->identifier();
return ret;
return ret;
}
void LtsToolBarArea::dragEnterEvent(QDragEnterEvent *event)
void LtsToolBarArea::dragEnterEvent(QDragEnterEvent* event)
{
LtsDragIcon *source =
qobject_cast<LtsDragIcon *>(event->source());
if (source)
{
if (!m_foreignButtonMap.contains(source))
LtsDragIcon* source = qobject_cast<LtsDragIcon*>(event->source());
if (source)
{
event->setDropAction(Qt::MoveAction);
event->accept();
if (!m_foreignButtonMap.contains(source))
{
event->setDropAction(Qt::MoveAction);
event->accept();
}
}
}
}
void LtsToolBarArea::dropEvent(QDropEvent *event)
void LtsToolBarArea::dropEvent(QDropEvent* event)
{
LtsDragIcon *source = qobject_cast<LtsDragIcon *>(event->source());
LtsDragIcon *after = nullptr;
QWidget *w = childAt(event->pos());
while (w)
{
after = qobject_cast<LtsDragIcon *>(w);
if (after)
break;
w = w->parentWidget();
}
LtsDragIcon* source = qobject_cast<LtsDragIcon*>(event->source());
addMenuEntry(source, after);
LtsDragIcon* after = nullptr;
QWidget* w = childAt(event->pos());
while (w)
{
after = qobject_cast<LtsDragIcon*>(w);
if (after)
break;
w = w->parentWidget();
}
addMenuEntry(source, after);
}
QMenu *LtsToolBarArea::functionKeyMenu(QWidget *parent)
QMenu* LtsToolBarArea::functionKeyMenu(QWidget* parent)
{
QMenu* menu = new QMenu(parent);
menu->setTitle(tr("Function Key"));
QAction *act;
for(auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
ShortCut &shorty = val.value();
act = menu->addAction(QStringLiteral("%1%2").arg(shorty.keyName(), !shorty.name.isEmpty() ? QStringLiteral(" - %1").arg(shorty.name) : QString()));
act->setData(shorty.shortcut->key()[0]);
QMenu* menu = new QMenu(parent);
menu->setTitle(tr("Function Key"));
QAction* act;
for (auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
ShortCut& shorty = val.value();
act = menu->addAction(QStringLiteral("%1%2").arg(
shorty.keyName(), !shorty.name.isEmpty() ? QStringLiteral(" - %1").arg(shorty.name) : QString()));
act->setData(QVariant::fromValue(shorty.shortcut->key()[0]));
connect(act, &QAction::triggered, this, &LtsToolBarArea::functionKeyMenuTriggered);
}
menu->addSeparator();
act = menu->addAction(tr("Remove Function Key"));
act->setData(-1);
connect(act, &QAction::triggered, this, &LtsToolBarArea::functionKeyMenuTriggered);
}
menu->addSeparator();
act = menu->addAction(tr("Remove Function Key"));
act->setData(-1);
connect(act, &QAction::triggered, this, &LtsToolBarArea::functionKeyMenuTriggered);
return menu;
return menu;
}
void LtsToolBarArea::functionKeyMenuTriggered()
{
QAction* act = qobject_cast<QAction*>(sender());
if (!act)
return;
int fkey = act->data().toInt();
QAction* act = qobject_cast<QAction*>(sender());
if (!act)
return;
int fkey = act->data().toInt();
if (fkey == -1)
removeFunctionKey(m_currentIdentifierForContextMenue);
else if (fkey > 0)
setFunctionKey(fkey, m_currentIdentifierForContextMenue);
if (fkey == -1)
removeFunctionKey(m_currentIdentifierForContextMenue);
else if (fkey > 0)
setFunctionKey(fkey, m_currentIdentifierForContextMenue);
}
bool LtsToolBarArea::removeFunctionKey(const QString &action)
bool LtsToolBarArea::removeFunctionKey(const QString& action)
{
if (action.isEmpty())
if (action.isEmpty())
return true;
for (auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
ShortCut& itShortcut = val.value();
if (itShortcut.identifier == action)
{
itShortcut.icon->removeModification();
itShortcut.clear();
break;
}
}
saveSettings();
return true;
for(auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
ShortCut &itShortcut = val.value();
if (itShortcut.identifier == action)
{
itShortcut.icon->removeModification();
itShortcut.clear();
break;
}
}
saveSettings();
return true;
}
bool LtsToolBarArea::setFunctionKey(int fkey, const QString &action)
bool LtsToolBarArea::setFunctionKey(int fkey, const QString& action)
{
if (fkey < Qt::Key_F5 || fkey > Qt::Key_F12)
return false;
LtsDragIcon *icon = nullptr;
for (LtsDragIcon *ic : std::as_const(m_buttonMap))
{
if (ic->identifier() == action)
if (fkey < Qt::Key_F5 || fkey > Qt::Key_F12)
return false;
LtsDragIcon* icon = nullptr;
for (LtsDragIcon* ic : std::as_const(m_buttonMap))
{
icon = ic;
break;
if (ic->identifier() == action)
{
icon = ic;
break;
}
}
}
if (!icon)
return false;
if (!icon)
return false;
ShortCut &shorty = m_functionKeys[fkey];
ShortCut& shorty = m_functionKeys[fkey];
for (LtsDragIcon *ic : std::as_const(m_buttonMap))
if (ic->identifier() == shorty.identifier)
ic->removeModification();
for (LtsDragIcon* ic : std::as_const(m_buttonMap))
if (ic->identifier() == shorty.identifier)
ic->removeModification();
for(auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
ShortCut &itShortcut = val.value();
if (itShortcut.identifier == action)
for (auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
itShortcut.clear();
break;
ShortCut& itShortcut = val.value();
if (itShortcut.identifier == action)
{
itShortcut.clear();
break;
}
}
}
shorty.clear();
shorty.identifier = icon->identifier();
shorty.name = icon->text();
shorty.icon = icon;
shorty.icon->setModification(shorty.keyName());
connect(shorty.shortcut, &QShortcut::activated, icon, &LtsDragIcon::clicked);
saveSettings();
return true;
shorty.clear();
shorty.identifier = icon->identifier();
shorty.name = icon->text();
shorty.icon = icon;
shorty.icon->setModification(shorty.keyName());
connect(shorty.shortcut, &QShortcut::activated, icon, &LtsDragIcon::clicked);
saveSettings();
return true;
}
QMap<int, QString> LtsToolBarArea::functionKeys() const
{
QMap<int, QString> retVal;
for(auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
const ShortCut &itShortcut = val.value();
if (!itShortcut.identifier.isEmpty())
retVal[itShortcut.key] = itShortcut.identifier;
}
return retVal;
}
void LtsToolBarArea::removeMenuAction(LtsDragIcon *icon)
{
for(auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
ShortCut &itShortcut = val.value();
if (itShortcut.identifier == icon->identifier())
itShortcut.clear();
}
for (LtsDragIcon *ic : std::as_const(m_foreignButtonMap))
{
if(ic->identifier() == icon->identifier())
QMap<int, QString> retVal;
for (auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
m_foreignButtonMap.removeAll(ic);
break;
const ShortCut& itShortcut = val.value();
if (!itShortcut.identifier.isEmpty())
retVal[itShortcut.key] = itShortcut.identifier;
}
}
m_buttonMap.removeAll(icon);
m_ui->layToolbar->removeWidget(icon);
delete icon;
saveSettings();
return retVal;
}
void LtsToolBarArea::showContextMenu(const QPoint &pos)
{
QPointer<LtsDragIcon> icon = qobject_cast<LtsDragIcon*>(sender());
if (!icon)
return;
const QPoint &globalPos = icon->mapToGlobal(pos);
QMenu *contextMenu = new QMenu(this);
contextMenu->setAttribute(Qt::WA_DeleteOnClose);
m_currentIdentifierForContextMenue = icon->identifier();
connect(contextMenu, &QObject::destroyed, this, [this](){
m_currentIdentifierForContextMenue.clear();
});
QAction *delAction = contextMenu->addAction(tr("Remove"));
connect(delAction, &QAction::triggered, this, [this, icon] () {
if (icon)
removeMenuAction(icon);
});
QMenu *fkeyMenu = functionKeyMenu(contextMenu);
contextMenu->addMenu(fkeyMenu);
contextMenu->popup(globalPos);
}
void LtsToolBarArea::saveSettings()
void LtsToolBarArea::removeMenuAction(LtsDragIcon* icon)
{
for (auto val = m_functionKeys.begin(); val != m_functionKeys.end(); ++val)
{
ShortCut& itShortcut = val.value();
if (itShortcut.identifier == icon->identifier())
itShortcut.clear();
}
for (LtsDragIcon* ic : std::as_const(m_foreignButtonMap))
{
if (ic->identifier() == icon->identifier())
{
m_foreignButtonMap.removeAll(ic);
break;
}
}
m_buttonMap.removeAll(icon);
m_ui->layToolbar->removeWidget(icon);
delete icon;
saveSettings();
}
}
void LtsToolBarArea::showContextMenu(const QPoint& pos)
{
QPointer<LtsDragIcon> icon = qobject_cast<LtsDragIcon*>(sender());
if (!icon)
return;
const QPoint& globalPos = icon->mapToGlobal(pos);
QMenu* contextMenu = new QMenu(this);
contextMenu->setAttribute(Qt::WA_DeleteOnClose);
m_currentIdentifierForContextMenue = icon->identifier();
connect(contextMenu, &QObject::destroyed, this, [this]() { m_currentIdentifierForContextMenue.clear(); });
QAction* delAction = contextMenu->addAction(tr("Remove"));
connect(delAction, &QAction::triggered, this, [this, icon]() {
if (icon)
removeMenuAction(icon);
});
QMenu* fkeyMenu = functionKeyMenu(contextMenu);
contextMenu->addMenu(fkeyMenu);
contextMenu->popup(globalPos);
}
void LtsToolBarArea::saveSettings() {}
} // namespace LtsWidgets