diff options
Diffstat (limited to 'src/designer/src/components/formeditor')
4 files changed, 19 insertions, 16 deletions
diff --git a/src/designer/src/components/formeditor/deviceprofiledialog.cpp b/src/designer/src/components/formeditor/deviceprofiledialog.cpp index 8e77b9ba3..3af31d47f 100644 --- a/src/designer/src/components/formeditor/deviceprofiledialog.cpp +++ b/src/designer/src/components/formeditor/deviceprofiledialog.cpp @@ -19,6 +19,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static const char *profileExtensionC = "qdp"; static inline QString fileFilter() @@ -130,10 +132,8 @@ void DeviceProfileDialog::save() QString fn = m_dlgGui->getSaveFileName(this, tr("Save Profile"), QString(), fileFilter()); if (fn.isEmpty()) return; - if (QFileInfo(fn).completeSuffix().isEmpty()) { - fn += QLatin1Char('.'); - fn += QLatin1String(profileExtensionC); - } + if (QFileInfo(fn).completeSuffix().isEmpty()) + fn += u'.' + QLatin1StringView(profileExtensionC); QFile file(fn); if (!file.open(QIODevice::WriteOnly|QIODevice::Text)) { diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp index efad969c8..74e80cfa6 100644 --- a/src/designer/src/components/formeditor/formwindow.cpp +++ b/src/designer/src/components/formeditor/formwindow.cpp @@ -1126,13 +1126,13 @@ bool FormWindow::unify(QObject *w, QString &s, bool changeIt) qlonglong num = 0; qlonglong factor = 1; qsizetype idx = s.size() - 1; - const ushort zeroUnicode = QLatin1Char('0').unicode(); + const char16_t zeroUnicode = u'0'; for ( ; idx > 0 && s.at(idx).isDigit(); --idx) { num += (s.at(idx).unicode() - zeroUnicode) * factor; factor *= 10; } // Position index past '_'. - const QChar underscore = QLatin1Char('_'); + const QChar underscore = u'_'; if (idx >= 0 && s.at(idx) == underscore) { idx++; } else { @@ -1699,7 +1699,7 @@ static inline DomUI *domUIFromClipboard(int *widgetCount, int *actionCount) { *widgetCount = *actionCount = 0; const QString clipboardText = qApp->clipboard()->text(); - if (clipboardText.isEmpty() || clipboardText.indexOf(QLatin1Char('<')) == -1) + if (clipboardText.isEmpty() || clipboardText.indexOf(u'<') == -1) return nullptr; QXmlStreamReader reader(clipboardText); diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp index e1206cca6..3b64c2f8a 100644 --- a/src/designer/src/components/formeditor/formwindowsettings.cpp +++ b/src/designer/src/components/formeditor/formwindowsettings.cpp @@ -189,7 +189,7 @@ FormWindowData FormWindowSettings::data() const const QString hints = m_ui->includeHintsTextEdit->toPlainText(); if (!hints.isEmpty()) { - rc.includeHints = hints.split(QLatin1Char('\n')); + rc.includeHints = hints.split(u'\n'); // Purge out any lines consisting of blanks only const QRegularExpression blankLine(u"^\\s*$"_s); Q_ASSERT(blankLine.isValid()); @@ -223,7 +223,7 @@ void FormWindowSettings::setData(const FormWindowData &data) if (data.includeHints.isEmpty()) { m_ui->includeHintsTextEdit->clear(); } else { - m_ui->includeHintsTextEdit->setText(data.includeHints.join(QLatin1Char('\n'))); + m_ui->includeHintsTextEdit->setText(data.includeHints.join(u'\n')); } m_ui->gridPanel->setChecked(data.hasFormGrid); diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp index 719d55ddc..64b227d0c 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp @@ -518,10 +518,10 @@ void QDesignerResource::saveDom(DomUI *ui, QWidget *widget) if (includeHint.isEmpty()) continue; DomInclude *incl = new DomInclude; - const QString location = includeHint.at(0) == QLatin1Char('<') ? global : local; - includeHint.remove(QLatin1Char('"')); - includeHint.remove(QLatin1Char('<')); - includeHint.remove(QLatin1Char('>')); + const QString location = includeHint.at(0) == u'<' ? global : local; + includeHint.remove(u'"'); + includeHint.remove(u'<'); + includeHint.remove(u'>'); incl->setAttributeLocation(location); incl->setText(includeHint); ui_includes.append(incl); @@ -671,9 +671,11 @@ QWidget *QDesignerResource::create(DomUI *ui, QWidget *parentWidget) continue; if (incl->hasAttributeLocation() && incl->attributeLocation() == global ) { - text = text.prepend(QLatin1Char('<')).append(QLatin1Char('>')); + text.prepend(u'<'); + text.append(u'>'); } else { - text = text.prepend(QLatin1Char('"')).append(QLatin1Char('"')); + text.prepend(u'"'); + text.append(u'"'); } includeHints.append(text); @@ -2112,7 +2114,8 @@ DomResources *QDesignerResource::saveResources(const QStringList &qrcPaths) QString conv_path = path; if (m_resourceBuilder->isSaveRelative()) conv_path = m_formWindow->absoluteDir().relativeFilePath(path); - dom_res->setAttributeLocation(conv_path.replace(QDir::separator(), QLatin1Char('/'))); + conv_path.replace(QDir::separator(), u'/'); + dom_res->setAttributeLocation(conv_path); dom_include.append(dom_res); } } |