summaryrefslogtreecommitdiff
path: root/src/designer/src/lib/shared/stylesheeteditor.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-03-21 15:35:44 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-04-21 17:18:09 +0200
commit00ff2b06a17e90921d79831a62e95eecf8c6954a (patch)
tree40877b8e595eda601252c995f57d1dd3166c8cd3 /src/designer/src/lib/shared/stylesheeteditor.cpp
parent6b7f6990aa1abed20c260a2eb2869f39ce59f8f7 (diff)
downloadqttools-00ff2b06a17e90921d79831a62e95eecf8c6954a.tar.gz
Qt Designer: Replace QLatin1Char by modern literals
Pick-to: 6.5 Change-Id: Ied11784e840d03542a5db281590729838ed625c3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/designer/src/lib/shared/stylesheeteditor.cpp')
-rw-r--r--src/designer/src/lib/shared/stylesheeteditor.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/designer/src/lib/shared/stylesheeteditor.cpp b/src/designer/src/lib/shared/stylesheeteditor.cpp
index 8141c4990..a77a51bd7 100644
--- a/src/designer/src/lib/shared/stylesheeteditor.cpp
+++ b/src/designer/src/lib/shared/stylesheeteditor.cpp
@@ -48,7 +48,7 @@ StyleSheetEditor::StyleSheetEditor(QWidget *parent)
{
enum : int { DarkThreshold = 200 }; // Observed 239 on KDE/Dark
- setTabStopDistance(fontMetrics().horizontalAdvance(QLatin1Char(' ')) * 4);
+ setTabStopDistance(fontMetrics().horizontalAdvance(u' ') * 4);
setAcceptRichText(false);
const QColor textColor = palette().color(QPalette::WindowText);
@@ -247,10 +247,8 @@ void StyleSheetEditorDialog::slotAddFont()
QFont font = QFontDialog::getFont(&ok, this);
if (ok) {
QString fontStr;
- if (font.weight() != QFont::Normal) {
- fontStr += QString::number(font.weight());
- fontStr += QLatin1Char(' ');
- }
+ if (font.weight() != QFont::Normal)
+ fontStr += QString::number(font.weight()) + u' ';
switch (font.style()) {
case QFont::StyleItalic:
@@ -265,7 +263,7 @@ void StyleSheetEditorDialog::slotAddFont()
fontStr += QString::number(font.pointSize());
fontStr += "pt \""_L1;
fontStr += font.family();
- fontStr += QLatin1Char('"');
+ fontStr += u'"';
insertCssProperty(u"font"_s, fontStr);
QString decoration;
@@ -273,7 +271,7 @@ void StyleSheetEditorDialog::slotAddFont()
decoration += "underline"_L1;
if (font.strikeOut()) {
if (!decoration.isEmpty())
- decoration += QLatin1Char(' ');
+ decoration += u' ';
decoration += "line-through"_L1;
}
insertCssProperty(u"text-decoration"_s, decoration);
@@ -297,13 +295,13 @@ void StyleSheetEditorDialog::insertCssProperty(const QString &name, const QStrin
closing.position() < opening.position());
QString insertion;
if (m_editor->textCursor().block().length() != 1)
- insertion += QLatin1Char('\n');
+ insertion += u'\n';
if (inSelector)
- insertion += QLatin1Char('\t');
+ insertion += u'\t';
insertion += name;
insertion += ": "_L1;
insertion += value;
- insertion += QLatin1Char(';');
+ insertion += u';';
cursor.insertText(insertion);
cursor.endEditBlock();
} else {