- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document
C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+
Build status: BUILD_RTI=OFF successful (0 errors, warnings only)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
56 lines
1.2 KiB
C++
56 lines
1.2 KiB
C++
|
|
|
|
#include "EventDelegate.h"
|
|
|
|
#include "PassiveEventContainer.h"
|
|
|
|
#include <QtCore/QDebug>
|
|
#include <QtCore/QModelIndex>
|
|
|
|
namespace LtsTimelineClassic
|
|
{
|
|
|
|
EventDelegate::EventDelegate(QWidget* parent) : QStyledItemDelegate(parent), m_liveTime(0) {}
|
|
|
|
QSize EventDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
|
|
{
|
|
(void)option;
|
|
(void)index;
|
|
|
|
return QSize(50, 20);
|
|
}
|
|
|
|
void EventDelegate::setKnownRanges(const QVector<Range>& knownRanges)
|
|
{
|
|
m_knownRanges = knownRanges;
|
|
}
|
|
|
|
void EventDelegate::setLiveTime(qint64 liveTime)
|
|
{
|
|
m_liveTime = liveTime;
|
|
}
|
|
|
|
void EventDelegate::slotAddLine(int posX, qint64 time)
|
|
{
|
|
m_lineMap.insert(posX, time);
|
|
}
|
|
|
|
void EventDelegate::slotResetLineList()
|
|
{
|
|
m_lineMap.clear();
|
|
}
|
|
|
|
void EventDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
|
{
|
|
if (index.data().canConvert<PassiveEventContainer*>())
|
|
{
|
|
PassiveEventContainer* passiveEventContainer = qvariant_cast<PassiveEventContainer*>(index.data());
|
|
|
|
passiveEventContainer->paint(painter, option, m_lineMap, m_knownRanges);
|
|
}
|
|
else
|
|
QStyledItemDelegate::paint(painter, option, index);
|
|
}
|
|
|
|
} // namespace LtsTimelineClassic
|