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
+69
-78
@@ -1,107 +1,98 @@
|
||||
#include "timeline_view_resize_handler.h"
|
||||
#include "timeline_view.h"
|
||||
#include "timeline_header_view.h"
|
||||
#include "item.h"
|
||||
#include "timeline_header_view.h"
|
||||
#include "timeline_view.h"
|
||||
#include "timeline_view_resize_handler.h"
|
||||
#include "track.h"
|
||||
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMouseEvent>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
namespace LtsTimeline
|
||||
{
|
||||
|
||||
TimelineViewTrackHandler::TimelineViewTrackHandler(TimelineView *view)
|
||||
: m_view(view)
|
||||
{
|
||||
}
|
||||
TimelineViewTrackHandler::TimelineViewTrackHandler(TimelineView* view) : m_view(view) {}
|
||||
|
||||
TimelineViewTrackHandler::~TimelineViewTrackHandler()
|
||||
{
|
||||
m_view = nullptr;
|
||||
m_view = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TimelineViewTrackHandler::mouseDoubleClickEvent(QMouseEvent *e)
|
||||
void TimelineViewTrackHandler::mouseDoubleClickEvent(QMouseEvent* e)
|
||||
{
|
||||
if (e->button() != Qt::LeftButton)
|
||||
return;
|
||||
|
||||
|
||||
const QModelIndex index = m_view->indexAt(e->pos());
|
||||
if (!index.isValid() || index.column() != Section::eActuator)
|
||||
return;
|
||||
|
||||
emit m_view->trackActivated(index.data().toInt());
|
||||
}
|
||||
|
||||
void TimelineViewTrackHandler::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->button() != Qt::LeftButton)
|
||||
{
|
||||
if (e->button() == Qt::RightButton)
|
||||
emit m_view->customContextMenuRequested(e->pos());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const QModelIndex index = m_view->indexAt(e->pos());
|
||||
if (!index.isValid() || index.column() != Section::eActuator)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
if(!m_view->timelineModel()->isEditable())
|
||||
return;
|
||||
|
||||
const Track &track = m_view->timelineModel()->track(index.data(Qt::UserRole).toInt());
|
||||
QRect visRect = m_view->visualRect(index);
|
||||
int buttonLength = visRect.height() / 2;
|
||||
if (track.hasInsertButton())
|
||||
{
|
||||
QRect rect = QRect(visRect.right() - buttonLength, visRect.top(), buttonLength, buttonLength);
|
||||
if (rect.contains(e->pos()))
|
||||
{
|
||||
m_pressedInsertButtonIndex = index;
|
||||
|
||||
m_view->timelineModel()->onInsertTrack(index);
|
||||
if (e->button() != Qt::LeftButton)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (track.hasRemoveButton())
|
||||
|
||||
const QModelIndex index = m_view->indexAt(e->pos());
|
||||
if (!index.isValid() || index.column() != Section::eActuator)
|
||||
return;
|
||||
|
||||
emit m_view->trackActivated(index.data().toInt());
|
||||
}
|
||||
|
||||
void TimelineViewTrackHandler::mousePressEvent(QMouseEvent* e)
|
||||
{
|
||||
if (e->button() != Qt::LeftButton)
|
||||
{
|
||||
QRect rect = QRect(visRect.right() - buttonLength, visRect.center().y(), buttonLength, buttonLength);
|
||||
if (rect.contains(e->pos()))
|
||||
{
|
||||
m_pressedRemoveButtonIndex = index;
|
||||
if (e->button() == Qt::RightButton)
|
||||
emit m_view->customContextMenuRequested(e->pos());
|
||||
return;
|
||||
}
|
||||
|
||||
auto msg = new LtsWidgets::LtsMessageDialogNew(m_view, {}, QApplication::translate("LtsTimeline", "Do you really want to remove this filter track and all of its contents?"),
|
||||
LtsWidgets::Behaviour::Modal, LtsWidgets::Button::Yes | LtsWidgets::Button::Cancel);
|
||||
const QModelIndex index = m_view->indexAt(e->pos());
|
||||
if (!index.isValid() || index.column() != Section::eActuator)
|
||||
return;
|
||||
|
||||
QObject::connect(msg, &LtsWidgets::LtsMessageDialogNew::yes,
|
||||
m_view, [this, index]()
|
||||
try
|
||||
{
|
||||
if (!m_view->timelineModel()->isEditable())
|
||||
return;
|
||||
|
||||
const Track& track = m_view->timelineModel()->track(index.data(Qt::UserRole).toInt());
|
||||
QRect visRect = m_view->visualRect(index);
|
||||
int buttonLength = visRect.height() / 2;
|
||||
if (track.hasInsertButton())
|
||||
{
|
||||
QRect rect = QRect(visRect.right() - buttonLength, visRect.top(), buttonLength, buttonLength);
|
||||
if (rect.contains(e->pos()))
|
||||
{
|
||||
m_pressedInsertButtonIndex = index;
|
||||
|
||||
m_view->timelineModel()->onRemoveTrack(index);
|
||||
});
|
||||
m_view->timelineModel()->onInsertTrack(index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (track.hasRemoveButton())
|
||||
{
|
||||
QRect rect = QRect(visRect.right() - buttonLength, visRect.center().y(), buttonLength, buttonLength);
|
||||
if (rect.contains(e->pos()))
|
||||
{
|
||||
m_pressedRemoveButtonIndex = index;
|
||||
|
||||
return;
|
||||
}
|
||||
auto msg = new LtsWidgets::LtsMessageDialogNew(
|
||||
m_view, {},
|
||||
QApplication::translate("LtsTimeline",
|
||||
"Do you really want to remove this filter track and all of its contents?"),
|
||||
LtsWidgets::Behaviour::Modal, LtsWidgets::Button::Yes | LtsWidgets::Button::Cancel);
|
||||
|
||||
QObject::connect(msg, &LtsWidgets::LtsMessageDialogNew::yes, m_view,
|
||||
[this, index]() { m_view->timelineModel()->onRemoveTrack(index); });
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (...) {}
|
||||
}
|
||||
|
||||
void TimelineViewTrackHandler::mouseReleaseEvent(QMouseEvent *e)
|
||||
void TimelineViewTrackHandler::mouseReleaseEvent(QMouseEvent* e)
|
||||
{
|
||||
Q_UNUSED(e);
|
||||
m_pressedInsertButtonIndex = {};
|
||||
m_pressedRemoveButtonIndex = {};
|
||||
Q_UNUSED(e);
|
||||
m_pressedInsertButtonIndex = {};
|
||||
m_pressedRemoveButtonIndex = {};
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsTimeline
|
||||
Reference in new issue
Block a user