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
+28
-33
@@ -1,60 +1,55 @@
|
||||
|
||||
|
||||
|
||||
#include "lts_elided_label.h"
|
||||
|
||||
#include <QPaintEvent>
|
||||
#include <QResizeEvent>
|
||||
|
||||
|
||||
namespace LtsWidgets
|
||||
{
|
||||
void LtsElidedLabel::setElideMode(Qt::TextElideMode elideMode)
|
||||
{
|
||||
m_elideMode = elideMode;
|
||||
m_cachedText.clear();
|
||||
update();
|
||||
m_elideMode = elideMode;
|
||||
m_cachedText.clear();
|
||||
update();
|
||||
}
|
||||
|
||||
void LtsElidedLabel::resizeEvent(QResizeEvent *e)
|
||||
void LtsElidedLabel::resizeEvent(QResizeEvent* e)
|
||||
{
|
||||
QLabel::resizeEvent(e);
|
||||
m_cachedText.clear();
|
||||
QLabel::resizeEvent(e);
|
||||
m_cachedText.clear();
|
||||
}
|
||||
|
||||
void LtsElidedLabel::paintEvent(QPaintEvent *e)
|
||||
void LtsElidedLabel::paintEvent(QPaintEvent* e)
|
||||
{
|
||||
if (m_elideMode == Qt::ElideNone)
|
||||
return QLabel::paintEvent(e);
|
||||
if (m_elideMode == Qt::ElideNone)
|
||||
return QLabel::paintEvent(e);
|
||||
|
||||
updateCachedTexts();
|
||||
QLabel::setText(m_cachedElidedText);
|
||||
QLabel::paintEvent(e);
|
||||
QLabel::setText(m_cachedText);
|
||||
updateCachedTexts();
|
||||
QLabel::setText(m_cachedElidedText);
|
||||
QLabel::paintEvent(e);
|
||||
QLabel::setText(m_cachedText);
|
||||
}
|
||||
|
||||
void LtsElidedLabel::updateCachedTexts()
|
||||
{
|
||||
|
||||
const auto txt = text();
|
||||
if (m_cachedText == txt)
|
||||
return;
|
||||
m_cachedText = txt;
|
||||
const QFontMetrics fm(fontMetrics());
|
||||
m_cachedElidedText = fm.elidedText(text(),
|
||||
m_elideMode,
|
||||
width(),
|
||||
Qt::TextShowMnemonic);
|
||||
if (!m_cachedText.isEmpty())
|
||||
{
|
||||
const QString showFirstCharacter = m_cachedText.at(0) + QStringLiteral("...");
|
||||
|
||||
const auto txt = text();
|
||||
if (m_cachedText == txt)
|
||||
return;
|
||||
m_cachedText = txt;
|
||||
const QFontMetrics fm(fontMetrics());
|
||||
m_cachedElidedText = fm.elidedText(text(), m_elideMode, width(), Qt::TextShowMnemonic);
|
||||
if (!m_cachedText.isEmpty())
|
||||
{
|
||||
const QString showFirstCharacter = m_cachedText.at(0) + QStringLiteral("...");
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
||||
const int width = fm.width(showFirstCharacter);
|
||||
const int width = fm.width(showFirstCharacter);
|
||||
#else
|
||||
const int width = fm.horizontalAdvance(showFirstCharacter);
|
||||
const int width = fm.horizontalAdvance(showFirstCharacter);
|
||||
#endif
|
||||
setMinimumWidth(width + 1);
|
||||
}
|
||||
setMinimumWidth(width + 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsWidgets
|
||||
Reference in new issue
Block a user