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
+41
-53
@@ -6,78 +6,66 @@
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
|
||||
namespace TopicEditorBase
|
||||
{
|
||||
|
||||
TopicPreviewer::TopicPreviewer(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
TopicPreviewer::TopicPreviewer(QWidget* parent) : QWidget(parent)
|
||||
{
|
||||
|
||||
|
||||
setVisible(false);
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
TopicPreviewer::~TopicPreviewer()
|
||||
{}
|
||||
TopicPreviewer::~TopicPreviewer() {}
|
||||
|
||||
|
||||
|
||||
|
||||
void TopicPreviewer::setTopicData(const TopicData &data)
|
||||
void TopicPreviewer::setTopicData(const TopicData& data)
|
||||
{
|
||||
m_topicData = data;
|
||||
m_topicData = data;
|
||||
|
||||
if (m_topicData.state)
|
||||
return;
|
||||
if (m_topicData.state)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TopicPreviewer::mousePressEvent(QMouseEvent *event)
|
||||
void TopicPreviewer::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
|
||||
if (m_topicData.topicType == TopicType::Invalid || m_topicData.duration < 1 || event->buttons() != Qt::LeftButton)
|
||||
return;
|
||||
|
||||
m_topicData.state = true;
|
||||
QByteArray byteArray;
|
||||
QDataStream dataStream(&byteArray, QIODevice::WriteOnly);
|
||||
dataStream << m_topicData;
|
||||
m_topicData.state = false;
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
mimeData->setData(TopicData::mime, byteArray);
|
||||
QDrag *drag = new QDrag(this);
|
||||
drag->setDragCursor(QPixmap(), Qt::CopyAction);
|
||||
drag->setMimeData(mimeData);
|
||||
emit startDragMe();
|
||||
if (drag->exec(Qt::CopyAction) == Qt::CopyAction)
|
||||
emit deleteMe();
|
||||
emit stopDragMe();
|
||||
if (m_topicData.topicType == TopicType::Invalid || m_topicData.duration < 1 || event->buttons() != Qt::LeftButton)
|
||||
return;
|
||||
|
||||
m_topicData.state = true;
|
||||
QByteArray byteArray;
|
||||
QDataStream dataStream(&byteArray, QIODevice::WriteOnly);
|
||||
dataStream << m_topicData;
|
||||
m_topicData.state = false;
|
||||
QMimeData* mimeData = new QMimeData;
|
||||
mimeData->setData(TopicData::mime, byteArray);
|
||||
QDrag* drag = new QDrag(this);
|
||||
drag->setDragCursor(QPixmap(), Qt::CopyAction);
|
||||
drag->setMimeData(mimeData);
|
||||
emit startDragMe();
|
||||
if (drag->exec(Qt::CopyAction) == Qt::CopyAction)
|
||||
emit deleteMe();
|
||||
emit stopDragMe();
|
||||
}
|
||||
|
||||
|
||||
void TopicPreviewer::paintEvent(QPaintEvent *event)
|
||||
void TopicPreviewer::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
if (m_topicData.topicType == TopicType::Invalid)
|
||||
return;
|
||||
if (m_topicData.topicType == TopicType::Invalid)
|
||||
return;
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setClipping(true);
|
||||
painter.setClipRect(rect(), Qt::ReplaceClip);
|
||||
painter.setPen(isEnabled() ? Qt::black : Qt::lightGray);
|
||||
painter.setBrush(QBrush(topicTypeColor(m_topicData.topicType)));
|
||||
painter.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||
painter.drawText(rect().adjusted(3, 16, -1, -1), m_topicData.description);
|
||||
if (!isEnabled())
|
||||
{
|
||||
painter.setBrush(QBrush(QColor(255, 255, 255, 204)));
|
||||
QPainter painter(this);
|
||||
painter.setClipping(true);
|
||||
painter.setClipRect(rect(), Qt::ReplaceClip);
|
||||
painter.setPen(isEnabled() ? Qt::black : Qt::lightGray);
|
||||
painter.setBrush(QBrush(topicTypeColor(m_topicData.topicType)));
|
||||
painter.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||
}
|
||||
|
||||
painter.drawText(rect().adjusted(3, 16, -1, -1), m_topicData.description);
|
||||
if (!isEnabled())
|
||||
{
|
||||
painter.setBrush(QBrush(QColor(255, 255, 255, 204)));
|
||||
painter.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace TopicEditorBase
|
||||
Reference in new issue
Block a user