diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/labs/settings/qqmlsettings.cpp | 8 | ||||
-rw-r--r-- | src/qmllocalstorage/qqmllocalstorage.cpp | 11 | ||||
-rw-r--r-- | src/quicklayouts/qquicklayout.cpp | 4 |
3 files changed, 14 insertions, 9 deletions
diff --git a/src/labs/settings/qqmlsettings.cpp b/src/labs/settings/qqmlsettings.cpp index ff8ec5e065..bf1ad021a7 100644 --- a/src/labs/settings/qqmlsettings.cpp +++ b/src/labs/settings/qqmlsettings.cpp @@ -330,9 +330,11 @@ void QQmlSettingsPrivate::load() for (int i = offset; i < count; ++i) { QMetaProperty property = mo->property(i); + const QString propertyName = QString::fromUtf8(property.name()); const QVariant previousValue = readProperty(property); - const QVariant currentValue = instance()->value(property.name(), previousValue); + const QVariant currentValue = instance()->value(propertyName, + previousValue); if (!currentValue.isNull() && (!previousValue.isValid() || (currentValue.canConvert(previousValue.metaType()) @@ -343,7 +345,7 @@ void QQmlSettingsPrivate::load() // ensure that a non-existent setting gets written // even if the property wouldn't change later - if (!instance()->contains(property.name())) + if (!instance()->contains(propertyName)) _q_propertyChanged(); // setup change notifications on first load @@ -358,7 +360,7 @@ void QQmlSettingsPrivate::store() { QHash<const char *, QVariant>::const_iterator it = changedProperties.constBegin(); while (it != changedProperties.constEnd()) { - instance()->setValue(it.key(), it.value()); + instance()->setValue(QString::fromUtf8(it.key()), it.value()); qCDebug(lcSettings) << "QQmlSettings: store" << it.key() << ":" << it.value(); ++it; } diff --git a/src/qmllocalstorage/qqmllocalstorage.cpp b/src/qmllocalstorage/qqmllocalstorage.cpp index 56b48189ba..8ab7c75ef7 100644 --- a/src/qmllocalstorage/qqmllocalstorage.cpp +++ b/src/qmllocalstorage/qqmllocalstorage.cpp @@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE } #define V4THROW_REFERENCE(string) { \ - QV4::ScopedString v(scope, scope.engine->newString(string)); \ + QV4::ScopedString v(scope, scope.engine->newString(QLatin1String(string))); \ scope.engine->throwReferenceError(v); \ RETURN_UNDEFINED(); \ } @@ -335,9 +335,12 @@ static ReturnedValue qmlsqldatabase_executeSql(const FunctionObject *b, const Va // XXX optimize ScopedString s(scope); ScopedValue v(scope); - resultObject->put((s = scope.engine->newIdentifier("rowsAffected")).getPointer(), (v = Value::fromInt32(query.numRowsAffected()))); - resultObject->put((s = scope.engine->newIdentifier("insertId")).getPointer(), (v = scope.engine->newString(query.lastInsertId().toString()))); - resultObject->put((s = scope.engine->newIdentifier("rows")).getPointer(), rows); + resultObject->put((s = scope.engine->newIdentifier(QLatin1String("rowsAffected"))).getPointer(), + (v = Value::fromInt32(query.numRowsAffected()))); + resultObject->put((s = scope.engine->newIdentifier(QLatin1String("insertId"))).getPointer(), + (v = scope.engine->newString(query.lastInsertId().toString()))); + resultObject->put((s = scope.engine->newIdentifier(QLatin1String("rows"))).getPointer(), + rows); } else { err = true; } diff --git a/src/quicklayouts/qquicklayout.cpp b/src/quicklayouts/qquicklayout.cpp index dbbd25de85..7af6bd86af 100644 --- a/src/quicklayouts/qquicklayout.cpp +++ b/src/quicklayouts/qquicklayout.cpp @@ -1236,9 +1236,9 @@ void QQuickLayout::_q_dumpLayoutTree() const void QQuickLayout::dumpLayoutTreeRecursive(int level, QString &buf) const { - auto formatLine = [&level](const char *fmt) { + auto formatLine = [&level](const char *fmt) -> QString { QString ss(level *4, QLatin1Char(' ')); - return QString::fromLatin1("%1%2\n").arg(ss).arg(fmt); + return ss + QLatin1String(fmt) + QLatin1Char('\n'); }; auto f2s = [](qreal f) { |