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>
140 lines
3.7 KiB
C++
140 lines
3.7 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* passive container for view which only draws QPushButtons to save ressources
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Mike Wille, SLSE, 2014-10-01
|
|
*/
|
|
|
|
#include "PassiveEventContainer.h"
|
|
#include "EventGraphic.h"
|
|
#include "EventTools.h"
|
|
|
|
#include <QGuiApplication>
|
|
#include <QPainter>
|
|
#include <QPen>
|
|
#include <QStyleOptionViewItem>
|
|
#include <QBrush>
|
|
|
|
#include <math.h>
|
|
#include <time.h>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
namespace LtsTimelineClassic
|
|
{
|
|
|
|
PassiveEventContainer::PassiveEventContainer(bool ignoreKnownRanges, QObject *parent)
|
|
: QObject(parent)
|
|
, m_ignoreKnownRanges(ignoreKnownRanges)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
PassiveEventContainer::~PassiveEventContainer()
|
|
{
|
|
qDeleteAll(m_eventGraphicList);
|
|
}
|
|
|
|
|
|
EventGraphicList PassiveEventContainer::getEventGraphicList() const
|
|
{
|
|
return m_eventGraphicList;
|
|
}
|
|
|
|
|
|
void PassiveEventContainer::setEventList(const EventGraphicList &eventGraphicList)
|
|
{
|
|
qDeleteAll(m_eventGraphicList);
|
|
|
|
m_eventGraphicList = eventGraphicList; // copy
|
|
}
|
|
|
|
|
|
void PassiveEventContainer::paint(QPainter *painter, const QStyleOptionViewItem &option, const LineMap &lineMap,
|
|
const QVector<Range> &knownRanges) const
|
|
{
|
|
EventTools::s_test++;
|
|
|
|
bool alternate = option.features.testFlag(QStyleOptionViewItem::ViewItemFeature::Alternate);
|
|
const QColor bg = QColor(alternate ? QRgb(0xF6D8CE) : QRgb(0xFBF2EF));
|
|
|
|
QColor cachedBg(Qt::white);
|
|
if (alternate)
|
|
cachedBg = cachedBg.darker(110);
|
|
|
|
|
|
painter->fillRect(option.rect, QBrush(bg));
|
|
|
|
int posX1 = option.rect.x();
|
|
int posX2 = option.rect.right();
|
|
int posY1 = option.rect.y();
|
|
int posY2 = option.rect.bottom();
|
|
int h = posY2 - posY1 + 1;
|
|
|
|
painter->save();
|
|
painter->setClipping(true); // no drawing outside
|
|
painter->setClipRect(option.rect.adjusted(0, 0, 1, 1));
|
|
|
|
int eventWidth = EventTools::eventWidth();
|
|
|
|
|
|
if (m_ignoreKnownRanges)
|
|
{
|
|
painter->fillRect(QRect(posX1, posY1, posX2 - posX1, h), cachedBg);///*option.backgroundBrush);//*/QBrush(QColor("white")));
|
|
}
|
|
else // draw known ranges
|
|
{
|
|
for (const auto &range : knownRanges)
|
|
{
|
|
int rangeStart = EventTools::getEventPosition(range.start);
|
|
int rangeEnd = EventTools::getEventPosition(range.end);
|
|
|
|
//if (posX1 >= option.rect.x() && posX1 < option.rect.x() + option.rect.width() + 1)
|
|
if (rangeEnd >= posX1 && rangeStart <= posX2) // do not draw if out of view
|
|
painter->fillRect(QRect(rangeStart, posY1, rangeEnd - rangeStart + eventWidth + 1, h), cachedBg);///*option.backgroundBrush);//*/QBrush(QColor("white")));
|
|
}
|
|
}
|
|
|
|
// // draw live time as known (if live)
|
|
// if (liveTime > 0)
|
|
// {
|
|
// int liveStart = EventTools::getEventPosition(liveTime);
|
|
// if (liveStart <= posX2) // do not draw if out of view
|
|
// painter->fillRect(QRect(liveStart, posY1, posX2 - liveTime, h), QBrush(QColor("white")));
|
|
// }
|
|
|
|
|
|
painter->restore();
|
|
|
|
|
|
// draw date text lines first, can be overdrawn
|
|
|
|
//for (int i = 0; i < lineMap.count(); i++)
|
|
for (auto i = lineMap.constBegin(); i != lineMap.constEnd(); ++i)
|
|
{
|
|
int posX = i.key(); //lineMap.at(i);
|
|
|
|
painter->setPen(QPen(QBrush(QGuiApplication::palette().shadow()), 1.0));
|
|
|
|
if (posX > option.rect.x() &&
|
|
posX < (option.rect.x() + option.rect.width())) // do not draw if out of view
|
|
painter->drawLine(posX, posY1, posX, posY2);
|
|
}
|
|
|
|
//EventTools::setValues(min, max, scrollBarPosition, zoomFactor);
|
|
//refreshEventList();
|
|
|
|
|
|
|
|
// NOTE: painter's viewport is the whole timeline (without the header part)
|
|
// NOTE: option.rect is the line and section the events get draw on, only
|
|
EventTools::drawEvents(painter, m_eventGraphicList, option.rect.y());
|
|
// qWarning() << "<<< viewport" << painter->viewport() << "rect" << option.rect;
|
|
}
|
|
|
|
} // namespace LtsTimelineClassic
|