LtsWidgets: Qt6 API fixes complete

- QComboBox::activated signal: QString→int parameter (lts_text_editor)
- qAsConst→std::as_const (5 files)
- localPos()→position() (lts_height_plot_widget)
- setMargin→setContentsMargins (tests/window.cpp)
- CMAKE_AUTOUIC OFF + include in header for MOC
- enterEvent(QEnterEvent*) signature fixes
- QRegExp→QRegularExpression replacements

All LtsWidgets module files now Qt6-compatible.
This commit is contained in:
torsten committed 2026-08-21 11:08:24 +02:00
1 parent ffa25fb394
commit 418443c841
25 files changed
+58 -47

No files matched your search

@@ -83,7 +83,7 @@ LtsTextEditor::LtsTextEditor(QWidget *parent)
slotBackgroundColorChanged(m_backgroundColor);
connect(m_ui->cbFonts, QOverload<const QString &>::of(&QComboBox::activated),
connect(m_ui->cbFonts, QOverload<int>::of(&QComboBox::activated),
this, &LtsTextEditor::slotTextFamily);
const QList<int> standardSizes = QFontDatabase::standardSizes();
@@ -91,7 +91,7 @@ LtsTextEditor::LtsTextEditor(QWidget *parent)
m_ui->cbFontSize->addItem(QString::number(size));
m_ui->cbFontSize->setCurrentIndex(standardSizes.indexOf(QApplication::font().pointSize()));
connect(m_ui->cbFontSize, QOverload<const QString &>::of(&QComboBox::activated),
connect(m_ui->cbFontSize, QOverload<int>::of(&QComboBox::activated),
this, &LtsTextEditor::slotTextSize);
connect(m_ui->cbFontSize->lineEdit(), &QLineEdit::editingFinished,
@@ -187,8 +187,9 @@ void LtsTextEditor::slotTextItalic()
}
void LtsTextEditor::slotTextFamily(const QString &f)
void LtsTextEditor::slotTextFamily(int index)
{
Q_UNUSED(index);
QTextCharFormat fmt;
if (m_ui->textEdit->document()->isEmpty())
{
@@ -200,14 +201,17 @@ void LtsTextEditor::slotTextFamily(const QString &f)
fmt.setFontPointSize(pointSize);
fmt.setForeground(m_foregroundColor);
}
const QString f = m_ui->cbFonts->currentText();
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
slotMergeFormatOnWordOrSelection(fmt);
}
void LtsTextEditor::slotTextSize(const QString &p)
void LtsTextEditor::slotTextSize(int index)
{
Q_UNUSED(index);
const QString p = m_ui->cbFontSize->currentText();
qreal pointSize = p.toFloat();
if (p.toFloat() > 0)