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

+58 -65
View File
@@ -1,7 +1,7 @@
#include "lts_text_edit_dialog.h"
#include "lts_text_editor.h"
#include <QHBoxLayout>
@@ -15,123 +15,116 @@
namespace LtsWidgets
{
LtsTextEditDialog::LtsTextEditDialog(QWidget *parent)
: LtsDialog(parent, ButtonCombination::OkApplyCancel)
#ifdef USE_TEXT_EDITOR
, m_textEditor(new LtsTextEditor(this))
#else
, m_textEditor2(new LtsTextEditor2(this))
#endif
{
QHBoxLayout *hbox = new QHBoxLayout(this);
LtsTextEditDialog::LtsTextEditDialog(QWidget* parent)
: LtsDialog(parent, ButtonCombination::OkApplyCancel)
#ifdef USE_TEXT_EDITOR
hbox->addWidget(m_textEditor);
connect(m_textEditor->textEdit(), &QTextEdit::textChanged, this, [this]() {
emit signalTextChanged(this->getHtmlText());
});
connect(m_textEditor, &LtsTextEditor::backgroundColorChanged,
this, &LtsTextEditDialog::onBackgroundColorChanged);
,
m_textEditor(new LtsTextEditor(this))
#else
hbox->addWidget(m_textEditor2);
connect(m_textEditor2->textEdit(), &QTextEdit::textChanged, this, [this]() {
emit signalTextChanged(this->getHtmlText());
});
connect(m_textEditor2, &LtsTextEditor2::backgroundColorChanged,
this, &LtsTextEditDialog::onBackgroundColorChanged);
,
m_textEditor2(new LtsTextEditor2(this))
#endif
{
QHBoxLayout* hbox = new QHBoxLayout(this);
#ifdef USE_TEXT_EDITOR
hbox->addWidget(m_textEditor);
connect(m_textEditor->textEdit(), &QTextEdit::textChanged, this,
[this]() { emit signalTextChanged(this->getHtmlText()); });
connect(m_textEditor, &LtsTextEditor::backgroundColorChanged, this, &LtsTextEditDialog::onBackgroundColorChanged);
#else
hbox->addWidget(m_textEditor2);
connect(m_textEditor2->textEdit(), &QTextEdit::textChanged, this,
[this]() { emit signalTextChanged(this->getHtmlText()); });
connect(m_textEditor2, &LtsTextEditor2::backgroundColorChanged, this, &LtsTextEditDialog::onBackgroundColorChanged);
#endif
enableBackgroundColor(false);
enableBackgroundColor(false);
}
LtsTextEditDialog::~LtsTextEditDialog()
{}
LtsTextEditDialog::~LtsTextEditDialog() {}
void LtsTextEditDialog::enableBackgroundColor(bool onOff)
{
#ifdef USE_TEXT_EDITOR
m_textEditor->enableBackgroundColor(onOff);
m_textEditor->enableBackgroundColor(onOff);
#else
m_textEditor2->enableBackgroundColor(onOff);
m_textEditor2->enableBackgroundColor(onOff);
#endif
}
void LtsTextEditDialog::retranslate()
{
QString name = tr("Edit Text");
translate(name);
QString name = tr("Edit Text");
translate(name);
}
bool LtsTextEditDialog::apply()
{
#ifdef USE_TEXT_EDITOR
QString textHtml = m_textEditor->textEdit()->document()->toHtml();
const QString backGroundColor = QLatin1String("background-color:'%1'; ").arg(m_textEditor->backgroundColor().name());
QString textHtml = m_textEditor->textEdit()->document()->toHtml();
const QString backGroundColor =
QLatin1String("background-color:'%1'; ").arg(m_textEditor->backgroundColor().name());
#else
QString textHtml = m_textEditor2->textEdit()->document()->toHtml();
const QString backGroundColor = QLatin1String("background-color:'%1'; ").arg(m_textEditor2->backgroundColor().name());
QString textHtml = m_textEditor2->textEdit()->document()->toHtml();
const QString backGroundColor =
QLatin1String("background-color:'%1'; ").arg(m_textEditor2->backgroundColor().name());
#endif
emit signalTextApplied(textHtml);
emit signalTextApplied(textHtml);
const int insertBackGroundColorIndex = textHtml.indexOf(QLatin1String("font-family"));
textHtml.insert(insertBackGroundColorIndex, backGroundColor);
const int insertBackGroundColorIndex = textHtml.indexOf(QLatin1String("font-family"));
textHtml.insert(insertBackGroundColorIndex, backGroundColor);
emit signalTextAppliedWithBackGroundColor(textHtml);
emit signalTextAppliedWithBackGroundColor(textHtml);
return true;
return true;
}
void LtsTextEditDialog::setHtml(const QString &htmlText)
void LtsTextEditDialog::setHtml(const QString& htmlText)
{
#ifdef USE_TEXT_EDITOR
m_textEditor->textEdit()->document()->setHtml(htmlText);
m_textEditor->textEdit()->document()->setHtml(htmlText);
#else
m_textEditor2->textEdit()->document()->setHtml(htmlText);
m_textEditor2->textEdit()->document()->setHtml(htmlText);
#endif
}
QString LtsTextEditDialog::getHtmlText() const
{
#ifdef USE_TEXT_EDITOR
if(m_textEditor && m_textEditor->textEdit() && m_textEditor->textEdit()->document())
return m_textEditor->textEdit()->document()->toHtml();
if (m_textEditor && m_textEditor->textEdit() && m_textEditor->textEdit()->document())
return m_textEditor->textEdit()->document()->toHtml();
#else
if(m_textEditor2 && m_textEditor2->textEdit() && m_textEditor2->textEdit()->document())
return m_textEditor2->textEdit()->document()->toHtml();
if (m_textEditor2 && m_textEditor2->textEdit() && m_textEditor2->textEdit()->document())
return m_textEditor2->textEdit()->document()->toHtml();
#endif
return {};
return {};
}
void LtsTextEditDialog::setInitialBackgroundColor(const QColor &bgColor)
void LtsTextEditDialog::setInitialBackgroundColor(const QColor& bgColor)
{
#ifdef USE_TEXT_EDITOR
if (m_textEditor)
m_textEditor->setInitialBackgroundColor(bgColor);
if (m_textEditor)
m_textEditor->setInitialBackgroundColor(bgColor);
#else
if (m_textEditor2)
m_textEditor2->setInitialBackgroundColor(bgColor);
if (m_textEditor2)
m_textEditor2->setInitialBackgroundColor(bgColor);
#endif
}
void LtsTextEditDialog::dialogCanceled()
{
emit signalDialogCanceled();
BaseClass::dialogCanceled();
emit signalDialogCanceled();
BaseClass::dialogCanceled();
}
void LtsTextEditDialog::onBackgroundColorChanged(const QColor &backgroundColor)
void LtsTextEditDialog::onBackgroundColorChanged(const QColor& backgroundColor)
{
slotChangesMade();
emit signalBackgroundColorChanged(backgroundColor);
slotChangesMade();
emit signalBackgroundColorChanged(backgroundColor);
}
}
} // namespace LtsWidgets