Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -0,0 +1,161 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* DBUpdate
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, 2021-02-17
|
||||
*/
|
||||
|
||||
#include "history_model.h"
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
|
||||
namespace DBUpdate
|
||||
{
|
||||
HistoryModel::HistoryModel(QObject *parent)
|
||||
: QAbstractTableModel(parent)
|
||||
, m_logger(getLogger("HistoryModel"))
|
||||
{
|
||||
}
|
||||
|
||||
HistoryModel::~HistoryModel()
|
||||
{
|
||||
}
|
||||
|
||||
bool HistoryModel::initModel(const QSqlDatabase &db, const QString &schema)
|
||||
{
|
||||
beginResetModel();
|
||||
m_vecData.clear();
|
||||
endResetModel();
|
||||
|
||||
NSqlQuery q(db);
|
||||
|
||||
QString stmt = QStringLiteral("SELECT id, version, description, updated, success, message FROM ") + schema + QStringLiteral(".db_version ORDER BY version DESC, updated DESC;");
|
||||
|
||||
if (!q.exec(stmt))
|
||||
return false;
|
||||
|
||||
while (q.next())
|
||||
{
|
||||
HistoryUpdate hu;
|
||||
hu.schema = schema;
|
||||
hu.id = q.value(0).toInt();
|
||||
hu.version = q.value(1).toString();
|
||||
hu.description = q.value(2).toString();
|
||||
hu.updated = q.value(3).toLongLong();
|
||||
hu.success = q.value(4).toBool();
|
||||
hu.message = q.value(5).toString();
|
||||
|
||||
insertRow(hu);
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "initModel - #history updates: " << m_vecData.size();
|
||||
return true;
|
||||
}
|
||||
|
||||
QVariant HistoryModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid() || index.row() >= m_vecData.size())
|
||||
return QVariant();
|
||||
|
||||
const HistoryUpdate &hu = m_vecData.at(index.row());
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
return hu.id;
|
||||
case Schema:
|
||||
return QString(hu.schema);
|
||||
case Version:
|
||||
return QString(hu.version);
|
||||
case Description:
|
||||
return QString(hu.description);
|
||||
case Updated:
|
||||
return DTG::toStringMSec(hu.updated);
|
||||
case Success:
|
||||
return hu.success;
|
||||
case Message:
|
||||
return hu.message;
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
int HistoryModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : m_vecData.size();
|
||||
}
|
||||
|
||||
int HistoryModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : Columns::Message + 1;
|
||||
}
|
||||
|
||||
QVariant HistoryModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
{
|
||||
Columns col = static_cast<Columns>(section);
|
||||
switch (col)
|
||||
{
|
||||
case Id:
|
||||
return tr("Id");
|
||||
case Schema:
|
||||
return tr("Schema");
|
||||
case Version:
|
||||
return tr("Version");
|
||||
case Description:
|
||||
return tr("Description");
|
||||
case Updated:
|
||||
return tr("Updated");
|
||||
case Message:
|
||||
return tr("Message");
|
||||
case Success:
|
||||
return tr("Success");
|
||||
}
|
||||
}
|
||||
return QAbstractTableModel::headerData(section, orientation, role);
|
||||
}
|
||||
|
||||
HistoryUpdate HistoryModel::getRowData(int row) const
|
||||
{
|
||||
if (row < 0 || row >= m_vecData.size())
|
||||
return HistoryUpdate();
|
||||
return m_vecData.at(row);
|
||||
}
|
||||
|
||||
bool HistoryModel::insertRow(const HistoryUpdate &item)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), m_vecData.size(), m_vecData.size());
|
||||
m_vecData.append(item);
|
||||
endInsertRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
void HistoryProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
|
||||
{
|
||||
m_sourceModel = qobject_cast<HistoryModel*>(sourceModel);
|
||||
QSortFilterProxyModel::setSourceModel(sourceModel);
|
||||
}
|
||||
|
||||
bool HistoryProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
|
||||
{
|
||||
if (!m_sourceModel ||
|
||||
source_left.column() != source_right.column() ||
|
||||
!source_left.isValid() ||
|
||||
!source_right.isValid())
|
||||
return QSortFilterProxyModel::lessThan(source_left, source_right);
|
||||
const auto &dataLeft = m_sourceModel->m_vecData.at(source_left.row());
|
||||
const auto dataRight = m_sourceModel->m_vecData.at(source_right.row());
|
||||
switch (source_left.column())
|
||||
{
|
||||
case HistoryModel::Updated:
|
||||
return dataLeft.updated < dataRight.updated;
|
||||
}
|
||||
return QSortFilterProxyModel::lessThan(source_left, source_right);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
Reference in new issue
Block a user