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:
torstenandCopilot committed 2026-08-19 14:46:29 +02:00
1 parent 1881d68aef
commit d6b6ffce7c
848 files changed
+89305 -100020

No files matched your search

+133 -139
View File
@@ -1,221 +1,215 @@
#include "lts_picture_editing.h"
#include "ui_lts_picture_editing.h"
#include "lts_picture_view.h"
#include <QFileDialog>
#include <QPixmap>
#include <QMessageBox>
#include <QImage>
#include <QGraphicsPixmapItem>
#include "lts_picture_view.h"
#include "ui_lts_picture_editing.h"
#include <QDebug>
#include <QFileDialog>
#include <QGraphicsPixmapItem>
#include <QImage>
#include <QMessageBox>
#include <QPixmap>
#include <QTimer>
LtsPictureEditing::LtsPictureEditing(QWidget *parent)
: QMainWindow(parent)
, m_gvPicture(nullptr)
, m_ui(new Ui::PictureEditing)
LtsPictureEditing::LtsPictureEditing(QWidget* parent)
: QMainWindow(parent), m_gvPicture(nullptr), m_ui(new Ui::PictureEditing)
{
m_ui->setupUi(this);
connect(m_ui->actionOpen, &QAction::triggered, this, &LtsPictureEditing::onOpenImage);
connect(m_ui->actionSave, &QAction::triggered, this, &LtsPictureEditing::onSavePicture);
connect(m_ui->actionQuit, &QAction::triggered, this, &LtsPictureEditing::close);
connect(m_ui->pbSetSize, &QPushButton::clicked, this, &LtsPictureEditing::onSetSize);
m_ui->setupUi(this);
connect(m_ui->actionOpen, &QAction::triggered, this, &LtsPictureEditing::onOpenImage);
connect(m_ui->actionSave, &QAction::triggered, this, &LtsPictureEditing::onSavePicture);
connect(m_ui->actionQuit, &QAction::triggered, this, &LtsPictureEditing::close);
connect(m_ui->pbSetSize, &QPushButton::clicked, this, &LtsPictureEditing::onSetSize);
connect(m_ui->sbHeight, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onRatioChanged);
connect(m_ui->sbWidth, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onRatioChanged);
connect(m_ui->chbRatio, &QPushButton::clicked, this, &LtsPictureEditing::onRatioClicked);
connect(m_ui->sbHeight, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onRatioChanged);
connect(m_ui->sbWidth, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onRatioChanged);
connect(m_ui->chbRatio, &QPushButton::clicked, this, &LtsPictureEditing::onRatioClicked);
connect(m_ui->sbXMin, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onLeftChanged);
connect(m_ui->sbXMax, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onRightChanged);
connect(m_ui->sbYMin, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onTopChanged);
connect(m_ui->sbYMax, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onBottomChanged);
connect(m_ui->sbXMin, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onLeftChanged);
connect(m_ui->sbXMax, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onRightChanged);
connect(m_ui->sbYMin, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onTopChanged);
connect(m_ui->sbYMax, QOverload<int>::of(&QSpinBox::valueChanged), this, &LtsPictureEditing::onBottomChanged);
addViewToFrame();
addViewToFrame();
connect(this, &LtsPictureEditing::leftChanged, m_gvPicture, &LtsWidgets::LtsPictureView::leftChanged);
connect(this, &LtsPictureEditing::rightChanged, m_gvPicture, &LtsWidgets::LtsPictureView::rightChanged);
connect(this, &LtsPictureEditing::topChanged, m_gvPicture, &LtsWidgets::LtsPictureView::topChanged);
connect(this, &LtsPictureEditing::bottomChanged, m_gvPicture, &LtsWidgets::LtsPictureView::bottomChanged);
connect(this, &LtsPictureEditing::leftChanged, m_gvPicture, &LtsWidgets::LtsPictureView::leftChanged);
connect(this, &LtsPictureEditing::rightChanged, m_gvPicture, &LtsWidgets::LtsPictureView::rightChanged);
connect(this, &LtsPictureEditing::topChanged, m_gvPicture, &LtsWidgets::LtsPictureView::topChanged);
connect(this, &LtsPictureEditing::bottomChanged, m_gvPicture, &LtsWidgets::LtsPictureView::bottomChanged);
connect(this, &LtsPictureEditing::setAspectRatio, m_gvPicture, &LtsWidgets::LtsPictureView::setAspectRatio);
connect(this, &LtsPictureEditing::ratioClicked, m_gvPicture, &LtsWidgets::LtsPictureView::ratioClicked);
connect(this, &LtsPictureEditing::setAspectRatio, m_gvPicture, &LtsWidgets::LtsPictureView::setAspectRatio);
connect(this, &LtsPictureEditing::ratioClicked, m_gvPicture, &LtsWidgets::LtsPictureView::ratioClicked);
connect(m_gvPicture, &LtsWidgets::LtsPictureView::mouseMoved, this, &LtsPictureEditing::setSpinboxValues);
connect(m_gvPicture, &LtsWidgets::LtsPictureView::setLimits, this, &LtsPictureEditing::setSpinboxLimits);
connect(this, &LtsPictureEditing::setPicture, m_gvPicture, &LtsWidgets::LtsPictureView::setPicture);
connect(m_gvPicture, &LtsWidgets::LtsPictureView::mouseMoved, this, &LtsPictureEditing::setSpinboxValues);
connect(m_gvPicture, &LtsWidgets::LtsPictureView::setLimits, this, &LtsPictureEditing::setSpinboxLimits);
connect(this, &LtsPictureEditing::setPicture, m_gvPicture, &LtsWidgets::LtsPictureView::setPicture);
onRatioChanged();
onRatioChanged();
}
LtsPictureEditing::~LtsPictureEditing()
{
delete m_ui;
delete m_ui;
}
void LtsPictureEditing::addViewToFrame()
{
QHBoxLayout *layout(new QHBoxLayout(m_ui->frPicFrame));
m_gvPicture = new LtsWidgets::LtsPictureView(m_ui->frPicFrame);
layout->addWidget(m_gvPicture);
m_gvPicture->setEnabled(false);
QHBoxLayout* layout(new QHBoxLayout(m_ui->frPicFrame));
m_gvPicture = new LtsWidgets::LtsPictureView(m_ui->frPicFrame);
layout->addWidget(m_gvPicture);
m_gvPicture->setEnabled(false);
}
void LtsPictureEditing::onOpenImage()
{
const QStringList filter ({
tr("Images (*.jpg *.jpeg *.png)")
});
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Image"),
QStringLiteral("../picture_editing"),
filter.join(QStringLiteral(";;")));
const QStringList filter({tr("Images (*.jpg *.jpeg *.png)")});
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Image"), QStringLiteral("../picture_editing"),
filter.join(QStringLiteral(";;")));
if (fileName.isEmpty())
return;
if (fileName.isEmpty())
return;
QFileInfo fi(fileName);
if (!fi.isReadable())
{
QMessageBox::warning(this, tr("Error!"), tr("An error occurred while loading the file.\n"
"The loaded file is not readable."));
return;
}
QFileInfo fi(fileName);
if (!fi.isReadable())
{
QMessageBox::warning(this, tr("Error!"),
tr("An error occurred while loading the file.\n"
"The loaded file is not readable."));
return;
}
QImage pic;
pic.load(fileName);
if (pic.isNull())
{
QMessageBox::warning(this, tr("Error!"), tr("An error occurred while loading the file.\n"
"The loaded file is no picture file.\n"
"Please load *.jpg, *.jpeg, *.png files only."));
return;
}
m_image = pic;
emit setPicture(pic, QPoint(0, 0), true);
m_gvPicture->setEnabled(true);
m_gvPicture->newRubberBand();
QImage pic;
pic.load(fileName);
if (pic.isNull())
{
QMessageBox::warning(this, tr("Error!"),
tr("An error occurred while loading the file.\n"
"The loaded file is no picture file.\n"
"Please load *.jpg, *.jpeg, *.png files only."));
return;
}
m_image = pic;
emit setPicture(pic, QPoint(0, 0), true);
m_gvPicture->setEnabled(true);
m_gvPicture->newRubberBand();
}
void LtsPictureEditing::onSetSize()
{
if (m_image.isNull())
return;
if (m_image.isNull())
return;
m_gvPicture->hideRubberband();
m_gvPicture->hideRubberband();
int xMin = m_ui->sbXMin->value() - 1;
int yMin = m_ui->sbYMin->value() - 1;
int xMax = m_ui->sbXMax->value() - 1;
int yMax = m_ui->sbYMax->value() - 1;
int xMin = m_ui->sbXMin->value() - 1;
int yMin = m_ui->sbYMin->value() - 1;
int xMax = m_ui->sbXMax->value() - 1;
int yMax = m_ui->sbYMax->value() - 1;
if (xMax < xMin || yMax < yMin || xMax == xMin || yMax == yMin)
{
clear();
return;
}
if (xMax < xMin || yMax < yMin || xMax == xMin || yMax == yMin)
{
clear();
return;
}
QRect picRect(xMin,
yMin,
xMax - xMin,
yMax - yMin);
QImage newPic = m_image.copy(picRect);
emit setPicture(newPic, QPoint(xMin, yMin), false);
QRect picRect(xMin, yMin, xMax - xMin, yMax - yMin);
QImage newPic = m_image.copy(picRect);
emit setPicture(newPic, QPoint(xMin, yMin), false);
}
void LtsPictureEditing::onSavePicture()
{
if (m_gvPicture->getImage()->pixmap().isNull())
{
QMessageBox::warning(this, tr("Error!"), tr("An error occurred while saving the picture\n"
"Please load a picture before saving it."));
return;
}
else
{
QString filename = QFileDialog::getSaveFileName(this, tr("Open Image"), QLatin1String("../picture_editing"),
tr("Images (*.jpg *.jpeg *.png)"));
if (filename.isEmpty())
if (m_gvPicture->getImage()->pixmap().isNull())
{
QMessageBox::warning(this, tr("Error!"), tr("An error occurred while saving the picture.\n"
"Please choose a valid path to save the picture."));
return;
QMessageBox::warning(this, tr("Error!"),
tr("An error occurred while saving the picture\n"
"Please load a picture before saving it."));
return;
}
else
{
QString filename = QFileDialog::getSaveFileName(this, tr("Open Image"), QLatin1String("../picture_editing"),
tr("Images (*.jpg *.jpeg *.png)"));
if (filename.isEmpty())
{
QMessageBox::warning(this, tr("Error!"),
tr("An error occurred while saving the picture.\n"
"Please choose a valid path to save the picture."));
return;
}
m_gvPicture->getImage()->pixmap().save(filename, "PNG");
}
m_gvPicture->getImage()->pixmap().save(filename, "PNG");
}
}
void LtsPictureEditing::setSpinboxLimits(const QSize &picSize, bool setValues)
void LtsPictureEditing::setSpinboxLimits(const QSize& picSize, bool setValues)
{
m_ui->sbXMin->setMaximum(picSize.width());
m_ui->sbXMax->setMaximum(picSize.width());
m_ui->sbYMin->setMaximum(picSize.height());
m_ui->sbYMax->setMaximum(picSize.height());
m_ui->sbXMin->setMaximum(picSize.width());
m_ui->sbXMax->setMaximum(picSize.width());
m_ui->sbYMin->setMaximum(picSize.height());
m_ui->sbYMax->setMaximum(picSize.height());
if (setValues)
{
m_ui->sbXMin->setValue(0);
m_ui->sbYMin->setValue(0);
m_ui->sbXMax->setValue(picSize.width() - 1);
m_ui->sbYMax->setValue(picSize.height() - 1);
}
if (setValues)
{
m_ui->sbXMin->setValue(0);
m_ui->sbYMin->setValue(0);
m_ui->sbXMax->setValue(picSize.width() - 1);
m_ui->sbYMax->setValue(picSize.height() - 1);
}
}
void LtsPictureEditing::setSpinboxValues(const QRect &picRect)
void LtsPictureEditing::setSpinboxValues(const QRect& picRect)
{
m_ui->sbXMin->setValue(picRect.left());
m_ui->sbYMin->setValue(picRect.top());
m_ui->sbXMax->setValue(picRect.right());
m_ui->sbYMax->setValue(picRect.bottom());
m_ui->sbXMin->setValue(picRect.left());
m_ui->sbYMin->setValue(picRect.top());
m_ui->sbXMax->setValue(picRect.right());
m_ui->sbYMax->setValue(picRect.bottom());
}
void LtsPictureEditing::onRatioChanged()
{
double ratio = double(m_ui->sbWidth->value()) / double(m_ui->sbHeight->value());
emit setAspectRatio(ratio);
double ratio = double(m_ui->sbWidth->value()) / double(m_ui->sbHeight->value());
emit setAspectRatio(ratio);
}
void LtsPictureEditing::onRatioClicked()
{
if (m_ui->chbRatio->isChecked())
{
m_ui->sbHeight->setEnabled(true);
m_ui->sbWidth->setEnabled(true);
emit ratioClicked(true);
}
else
{
m_ui->sbHeight->setEnabled(false);
m_ui->sbWidth->setEnabled(false);
emit ratioClicked(false);
}
if (m_ui->chbRatio->isChecked())
{
m_ui->sbHeight->setEnabled(true);
m_ui->sbWidth->setEnabled(true);
emit ratioClicked(true);
}
else
{
m_ui->sbHeight->setEnabled(false);
m_ui->sbWidth->setEnabled(false);
emit ratioClicked(false);
}
}
void LtsPictureEditing::onLeftChanged(int left)
{
emit leftChanged(left);
emit leftChanged(left);
}
void LtsPictureEditing::onRightChanged(int right)
{
emit rightChanged(right);
emit rightChanged(right);
}
void LtsPictureEditing::onTopChanged(int top)
{
emit topChanged(top);
emit topChanged(top);
}
void LtsPictureEditing::onBottomChanged(int bottom)
{
emit bottomChanged(bottom);
emit bottomChanged(bottom);
}
void LtsPictureEditing::clear()
{
emit setPicture(QImage(), QPoint(), false);
emit setPicture(QImage(), QPoint(), false);
}
+37 -39
View File
@@ -1,61 +1,59 @@
#pragma once
#include <QObject>
#include <QMainWindow>
#include <QObject>
namespace Ui
{
class PictureEditing;
}
namespace LtsWidgets{
class LtsPictureView;
namespace LtsWidgets
{
class LtsPictureView;
}
class LtsPictureEditing : public QMainWindow
{
Q_OBJECT
Q_OBJECT
public:
explicit LtsPictureEditing(QWidget *parent = nullptr);
~LtsPictureEditing();
public:
explicit LtsPictureEditing(QWidget* parent = nullptr);
~LtsPictureEditing();
private:
QImage m_grayImage;
QImage m_image;
private:
QImage m_grayImage;
QImage m_image;
LtsWidgets::LtsPictureView *m_gvPicture;
LtsWidgets::LtsPictureView* m_gvPicture;
Ui::PictureEditing *m_ui;
Ui::PictureEditing* m_ui;
private:
void setSpinboxLimits(const QSize &picSize, bool setValues = true);
void clear();
void addViewToFrame();
void initRatio();
private:
void setSpinboxLimits(const QSize& picSize, bool setValues = true);
void clear();
void addViewToFrame();
void initRatio();
private slots:
void onOpenImage();
void onSetSize();
void setSpinboxValues(const QRect &picRect);
void onRatioChanged();
void onRatioClicked();
void onSavePicture();
void onLeftChanged(int left);
void onRightChanged(int right);
void onTopChanged(int top);
void onBottomChanged(int bottom);
private slots:
void onOpenImage();
void onSetSize();
void setSpinboxValues(const QRect& picRect);
void onRatioChanged();
void onRatioClicked();
void onSavePicture();
void onLeftChanged(int left);
void onRightChanged(int right);
void onTopChanged(int top);
void onBottomChanged(int bottom);
signals:
void setPicture(const QImage &, const QPoint &, const bool flag);
void setAspectRatio(double ratio);
void ratioClicked(bool enabled);
int leftChanged(int left);
int rightChanged(int right);
int topChanged(int top);
int bottomChanged(int bottom);
signals:
void setPicture(const QImage&, const QPoint&, const bool flag);
void setAspectRatio(double ratio);
void ratioClicked(bool enabled);
int leftChanged(int left);
int rightChanged(int right);
int topChanged(int top);
int bottomChanged(int bottom);
};
@@ -1,39 +1,38 @@
#include "lts_picture_editing.h"
#include <QApplication>
#include <iostream>
static void qtMsgHandler(QtMsgType type, const QMessageLogContext &, const QString &msg)
static void qtMsgHandler(QtMsgType type, const QMessageLogContext&, const QString& msg)
{
switch (type)
{
case QtDebugMsg:
std::cout << "DEBUG: " << qPrintable(msg) << std::endl;
break;
case QtInfoMsg:
std::cout << "INFO: " << qPrintable(msg) << std::endl;
break;
case QtWarningMsg:
std::cout << "WARN: " << qPrintable(msg) << std::endl;
break;
case QtCriticalMsg:
std::cerr << "ERROR: " << qPrintable(msg) << std::endl;
break;
case QtFatalMsg:
std::cerr << "FATAL: " << qPrintable(msg) << std::endl;
break;
}
switch (type)
{
case QtDebugMsg:
std::cout << "DEBUG: " << qPrintable(msg) << std::endl;
break;
case QtInfoMsg:
std::cout << "INFO: " << qPrintable(msg) << std::endl;
break;
case QtWarningMsg:
std::cout << "WARN: " << qPrintable(msg) << std::endl;
break;
case QtCriticalMsg:
std::cerr << "ERROR: " << qPrintable(msg) << std::endl;
break;
case QtFatalMsg:
std::cerr << "FATAL: " << qPrintable(msg) << std::endl;
break;
}
}
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
qInstallMessageHandler(&qtMsgHandler);
LtsPictureEditing w;
w.show();
QApplication a(argc, argv);
qInstallMessageHandler(&qtMsgHandler);
LtsPictureEditing w;
w.show();
return a.exec();
return a.exec();
}
+9 -25
View File
@@ -1,31 +1,15 @@
#include "window.h"
#include <LtsWidgets/lts_date_time_edit.h>
#include <QApplication>
#include "window.h"
#include <LtsWidgets/lts_date_time_edit.h>
int main(int argc, char **argv)
int main(int argc, char** argv)
{
QApplication app(argc, argv);
QApplication app(argc, argv);
LtsWidgets::LtsDateTimeEdit dte;
dte.activateWindow();
dte.show();
LtsWidgets::LtsDateTimeEdit dte;
dte.activateWindow();
dte.show();
return app.exec();
return app.exec();
}
+26 -37
View File
@@ -1,59 +1,48 @@
#include "window.h"
#include <LtsWidgets/lts_notification_box.h>
#include <QApplication>
#include <QHBoxLayout>
namespace LtsWidgets
{
Window::Window(QWidget *parent)
: QWidget(parent)
Window::Window(QWidget* parent) : QWidget(parent)
{
setGeometry(x(), y(), 300, 300);
setGeometry(x(), y(), 300, 300);
QHBoxLayout *lay = new QHBoxLayout;
QHBoxLayout* lay = new QHBoxLayout;
lay->setMargin(0);
lay->setMargin(0);
auto x1 = new LtsWidgets::LtsNotificationBox;
lay->addWidget(x1);
auto x1 = new LtsWidgets::LtsNotificationBox;
lay->addWidget(x1);
if (qApp->arguments().count() < 2)
abort();
LtsNotificationBox::MessageType type;
if (qApp->arguments().count() < 2)
abort();
if (qApp->arguments().at(1) == QStringLiteral("e"))
type = LtsNotificationBox::MessageType::Error;
else if (qApp->arguments().at(1) == QStringLiteral("w"))
type = LtsNotificationBox::MessageType::Warning;
else if (qApp->arguments().at(1) == QStringLiteral("i"))
type = LtsNotificationBox::MessageType::Info;
else if (qApp->arguments().at(1) == QStringLiteral("s"))
type = LtsNotificationBox::MessageType::Success;
else
abort();
x1->message(QStringLiteral("Title Message"),
QStringLiteral("A text that consists of a lot of characters and also even has<br />two lines."), type);
connect(x1, &LtsNotificationBox::signalClose, this, &QWidget::close);
LtsNotificationBox::MessageType type;
setLayout(lay);
if (qApp->arguments().at(1) == QStringLiteral("e"))
type = LtsNotificationBox::MessageType::Error;
else if (qApp->arguments().at(1) == QStringLiteral("w"))
type = LtsNotificationBox::MessageType::Warning;
else if (qApp->arguments().at(1) == QStringLiteral("i"))
type = LtsNotificationBox::MessageType::Info;
else if (qApp->arguments().at(1) == QStringLiteral("s"))
type = LtsNotificationBox::MessageType::Success;
else
abort();
x1->message(QStringLiteral("Title Message"), QStringLiteral("A text that consists of a lot of characters and also even has<br />two lines."), type);
connect(x1, &LtsNotificationBox::signalClose, this, &QWidget::close);
setLayout(lay);
setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_TranslucentBackground);
}
Window::~Window() {}
Window::~Window()
{
}
}
} // namespace LtsWidgets
+5 -8
View File
@@ -1,17 +1,14 @@
#pragma once
#include <QObject>
#include <QWidget>
namespace LtsWidgets
{
class Window : public QWidget
{
Q_OBJECT
public:
Window(QWidget *parent = nullptr);
~Window();
Q_OBJECT
public:
Window(QWidget* parent = nullptr);
~Window();
};
}
} // namespace LtsWidgets