aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-02 16:08:59 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-03 15:47:06 +0200
commit33a7f5ee4d8d4dc197100e3cda141063b89f74e6 (patch)
tree58a48bb5ab2a45d35c11187c6aeb4c94f974724c /src/qml/qml
parent5e0bf417fb38c53d4ae43f9f84fe42461cd2e00c (diff)
QtQml: Use unicode character literals
This avoids the warnings on conversion to QChar. Change-Id: Ib774f24592d6f09a531c60bb6fa6e5bdbec88120 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp6
-rw-r--r--src/qml/qml/qqmlproperty.cpp8
-rw-r--r--src/qml/qml/qqmltypedata.cpp4
3 files changed, 8 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 4587ac3cc8..761016669c 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -379,7 +379,7 @@ bool checkRegistration(QQmlType::RegistrationType typeType, QQmlMetaTypeData *da
int typeNameLen = typeName.length();
for (int ii = 0; ii < typeNameLen; ++ii) {
- if (!(typeName.at(ii).isLetterOrNumber() || typeName.at(ii) == '_')) {
+ if (!(typeName.at(ii).isLetterOrNumber() || typeName.at(ii) == u'_')) {
QString failure(QCoreApplication::translate("qmlRegisterType", "Invalid QML %1 name \"%2\""));
data->recordTypeRegFailure(failure.arg(registrationTypeString(typeType)).arg(typeName));
return false;
@@ -846,10 +846,10 @@ QQmlType QQmlMetaType::typeForUrl(const QString &urlString,
// data.
if (errors) {
QQmlError error;
- error.setDescription(failures.join('\n'));
+ error.setDescription(failures.join(u'\n'));
errors->prepend(error);
} else {
- qWarning("%s", failures.join('\n').toLatin1().constData());
+ qWarning("%s", failures.join(u'\n').toLatin1().constData());
}
return QQmlType();
}
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 1d95de9631..9595675ba6 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -355,16 +355,14 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name)
terminal = path.last();
}
- if (terminal.count() >= 3 &&
- terminal.at(0) == QLatin1Char('o') &&
- terminal.at(1) == QLatin1Char('n') &&
- (terminal.at(2).isUpper() || terminal.at(2) == '_')) {
+ if (terminal.count() >= 3 && terminal.at(0) == u'o' && terminal.at(1) == u'n'
+ && (terminal.at(2).isUpper() || terminal.at(2) == u'_')) {
QString signalName = terminal.mid(2).toString();
int firstNon_;
int length = signalName.length();
for (firstNon_ = 0; firstNon_ < length; ++firstNon_)
- if (signalName.at(firstNon_) != '_')
+ if (signalName.at(firstNon_) != u'_')
break;
signalName[firstNon_] = signalName.at(firstNon_).toLower();
diff --git a/src/qml/qml/qqmltypedata.cpp b/src/qml/qml/qqmltypedata.cpp
index 3b50027c4f..324d5a863f 100644
--- a/src/qml/qml/qqmltypedata.cpp
+++ b/src/qml/qml/qqmltypedata.cpp
@@ -351,7 +351,7 @@ void QQmlTypeData::done()
auto objectId = containingType.lookupInlineComponentIdByName(type.type.pendingResolutionName());
if (objectId < 0) { // can be any negative number if we tentatively resolved it in QQmlImport but it actually was not an inline component
const QString typeName = stringAt(it.key());
- int lastDot = typeName.lastIndexOf('.');
+ int lastDot = typeName.lastIndexOf(u'.');
QList<QQmlError> errors = type.typeData ? type.typeData->errors() : QList<QQmlError>{};
QQmlError error;
@@ -505,7 +505,7 @@ void QQmlTypeData::done()
// associate inline components to root component
{
- auto typeName = finalUrlString().splitRef('/').last().split('.').first().toString();
+ auto typeName = finalUrlString().splitRef(u'/').last().split(u'.').first().toString();
// typeName can be empty if a QQmlComponent was constructed with an empty QUrl parameter
if (!typeName.isEmpty() && typeName.at(0).isUpper() && !m_inlineComponentData.isEmpty()) {
QHashedStringRef const hashedStringRef { typeName };