Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+90
-101
@@ -1,149 +1,138 @@
|
||||
|
||||
|
||||
|
||||
#include "TimelineWidget.h"
|
||||
#include "TimelineHeaderView.h"
|
||||
|
||||
#include "TimelineWidget.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QPen>
|
||||
#include <QPoint>
|
||||
#include <QRect>
|
||||
#include <QGuiApplication>
|
||||
|
||||
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
|
||||
TimelineHeaderView::TimelineHeaderView(QWidget *parent)
|
||||
: QHeaderView(Qt::Horizontal, parent)
|
||||
, m_posMarkTime(0)
|
||||
, m_paintingRange(rect())
|
||||
, m_liveTime(0)
|
||||
TimelineHeaderView::TimelineHeaderView(QWidget* parent)
|
||||
: QHeaderView(Qt::Horizontal, parent), m_posMarkTime(0), m_paintingRange(rect()), m_liveTime(0)
|
||||
{
|
||||
setSectionsClickable(true);
|
||||
setSectionsClickable(true);
|
||||
|
||||
setStretchLastSection(true);
|
||||
setStretchLastSection(true);
|
||||
|
||||
connect(this, &TimelineHeaderView::sectionResized,
|
||||
this, &TimelineHeaderView::slotSectionResized);
|
||||
|
||||
connect(this, &TimelineHeaderView::sectionResized, this, &TimelineHeaderView::slotSectionResized);
|
||||
}
|
||||
|
||||
#define GET_LOGGER NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Timeline.HeaderView")
|
||||
|
||||
void TimelineHeaderView::setPosMarkTime(qint64 time)
|
||||
{
|
||||
m_posMarkTime = time;
|
||||
refreshData();
|
||||
m_posMarkTime = time;
|
||||
refreshData();
|
||||
}
|
||||
|
||||
void TimelineHeaderView::setLiveTime(qint64 time)
|
||||
{
|
||||
m_liveTime = time;
|
||||
refreshData();
|
||||
m_liveTime = time;
|
||||
refreshData();
|
||||
}
|
||||
|
||||
void TimelineHeaderView::setPosMarkPos()
|
||||
{
|
||||
|
||||
|
||||
if (m_posMarkTime > 0)
|
||||
{
|
||||
int posMarkPos = EventTools::getEventPosition(m_posMarkTime);
|
||||
emit signalSetPosMarkPos(posMarkPos);
|
||||
refreshData();
|
||||
}
|
||||
if (m_posMarkTime > 0)
|
||||
{
|
||||
int posMarkPos = EventTools::getEventPosition(m_posMarkTime);
|
||||
emit signalSetPosMarkPos(posMarkPos);
|
||||
refreshData();
|
||||
}
|
||||
}
|
||||
|
||||
void TimelineHeaderView::refreshData()
|
||||
{
|
||||
if (EventTools::getTimelineMin() > 0 && EventTools::getTimelineMax() > 1)
|
||||
{
|
||||
updateSection(1);
|
||||
updateSection(0);
|
||||
}
|
||||
if (EventTools::getTimelineMin() > 0 && EventTools::getTimelineMax() > 1)
|
||||
{
|
||||
updateSection(1);
|
||||
updateSection(0);
|
||||
}
|
||||
}
|
||||
|
||||
void TimelineHeaderView::slotSectionResized(int logicalIndex, int oldSize, int newSize)
|
||||
{
|
||||
(void)oldSize;
|
||||
(void)oldSize;
|
||||
|
||||
if (logicalIndex == 1)
|
||||
m_paintingRange = QRect(0, 0, newSize, height());
|
||||
if (logicalIndex == 1)
|
||||
m_paintingRange = QRect(0, 0, newSize, height());
|
||||
|
||||
refreshData();
|
||||
refreshData();
|
||||
}
|
||||
|
||||
void TimelineHeaderView::paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const
|
||||
void TimelineHeaderView::paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const
|
||||
{
|
||||
painter->save();
|
||||
QHeaderView::paintSection(painter, rect, logicalIndex);
|
||||
painter->restore();
|
||||
|
||||
|
||||
if (logicalIndex == 1)
|
||||
{
|
||||
int h = (rect.height() / 3);
|
||||
int y = rect.height() - h;
|
||||
int w = h;
|
||||
|
||||
|
||||
|
||||
painter->save();
|
||||
painter->setClipping(true);
|
||||
|
||||
if (m_posMarkTime != 0)
|
||||
{
|
||||
double posMark = EventTools::getEventPosition(m_posMarkTime);
|
||||
int x = + posMark;
|
||||
|
||||
if (x >= sectionPosition(1))
|
||||
{
|
||||
painter->setPen(QPen(QGuiApplication::palette().color(QPalette::Inactive, QPalette::Highlight)));
|
||||
painter->setBrush(QGuiApplication::palette().highlight());
|
||||
|
||||
QPolygon pol;
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
pol.append(QPoint(x + 0, y + h));
|
||||
pol.append(QPoint(x + (w / 2), y + 0));
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(x, y);
|
||||
path.addPolygon(pol);
|
||||
|
||||
painter->drawPath(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (m_liveTime != 0)
|
||||
{
|
||||
int posLive = EventTools::getEventPosition(m_liveTime);
|
||||
int x = posLive;
|
||||
|
||||
if (x >= sectionPosition(1))
|
||||
{
|
||||
painter->setPen(QPen(QColor("green")));
|
||||
painter->setBrush(QBrush(QColor("green")));
|
||||
|
||||
QPolygon pol;
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
pol.append(QPoint(x + 0, y + h));
|
||||
pol.append(QPoint(x + (w / 2), y + 0));
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(x, y);
|
||||
path.addPolygon(pol);
|
||||
|
||||
painter->drawPath(path);
|
||||
}
|
||||
}
|
||||
|
||||
QHeaderView::paintSection(painter, rect, logicalIndex);
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
if (logicalIndex == 1)
|
||||
{
|
||||
int h = (rect.height() / 3);
|
||||
int y = rect.height() - h;
|
||||
int w = h;
|
||||
|
||||
painter->save();
|
||||
painter->setClipping(true);
|
||||
|
||||
if (m_posMarkTime != 0)
|
||||
{
|
||||
double posMark = EventTools::getEventPosition(m_posMarkTime);
|
||||
int x = +posMark;
|
||||
|
||||
if (x >= sectionPosition(1))
|
||||
{
|
||||
painter->setPen(QPen(QGuiApplication::palette().color(QPalette::Inactive, QPalette::Highlight)));
|
||||
painter->setBrush(QGuiApplication::palette().highlight());
|
||||
|
||||
QPolygon pol;
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
pol.append(QPoint(x + 0, y + h));
|
||||
pol.append(QPoint(x + (w / 2), y + 0));
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(x, y);
|
||||
path.addPolygon(pol);
|
||||
|
||||
painter->drawPath(path);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_liveTime != 0)
|
||||
{
|
||||
int posLive = EventTools::getEventPosition(m_liveTime);
|
||||
int x = posLive;
|
||||
|
||||
if (x >= sectionPosition(1))
|
||||
{
|
||||
painter->setPen(QPen(QColor("green")));
|
||||
painter->setBrush(QBrush(QColor("green")));
|
||||
|
||||
QPolygon pol;
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
pol.append(QPoint(x + 0, y + h));
|
||||
pol.append(QPoint(x + (w / 2), y + 0));
|
||||
pol.append(QPoint(x + (-w / 2), y + 0));
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(x, y);
|
||||
path.addPolygon(pol);
|
||||
|
||||
painter->drawPath(path);
|
||||
}
|
||||
}
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsTimelineClassic
|
||||
Reference in new issue
Block a user