diff options
Diffstat (limited to 'src/quick/designer')
6 files changed, 19 insertions, 18 deletions
diff --git a/src/quick/designer/qquickdesignercustomobjectdata.cpp b/src/quick/designer/qquickdesignercustomobjectdata.cpp index cdd587b67d..1666ffb0a5 100644 --- a/src/quick/designer/qquickdesignercustomobjectdata.cpp +++ b/src/quick/designer/qquickdesignercustomobjectdata.cpp @@ -143,7 +143,7 @@ void QQuickDesignerCustomObjectData::populateResetHashes() QQuickDesignerSupportProperties::propertyNameListForWritableProperties(object()); Q_FOREACH (const QQuickDesignerSupport::PropertyName &propertyName, propertyNameList) { - QQmlProperty property(object(), propertyName, QQmlEngine::contextForObject(object())); + QQmlProperty property(object(), QString::fromUtf8(propertyName), QQmlEngine::contextForObject(object())); QQmlAbstractBinding::Ptr binding = QQmlAbstractBinding::Ptr(QQmlPropertyPrivate::binding(property)); @@ -167,7 +167,7 @@ QVariant QQuickDesignerCustomObjectData::getResetValue(const QQuickDesignerSuppo void QQuickDesignerCustomObjectData::doResetProperty(QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName) { - QQmlProperty property(object(), propertyName, context); + QQmlProperty property(object(), QString::fromUtf8(propertyName), context); if (!property.isValid()) return; @@ -224,7 +224,7 @@ bool QQuickDesignerCustomObjectData::hasBindingForProperty(QQmlContext *context, if (QQuickDesignerSupportProperties::isPropertyBlackListed(propertyName)) return false; - QQmlProperty property(object(), propertyName, context); + QQmlProperty property(object(), QString::fromUtf8(propertyName), context); bool hasBinding = QQmlPropertyPrivate::binding(property); @@ -241,7 +241,7 @@ void QQuickDesignerCustomObjectData::setPropertyBinding(QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName, const QString &expression) { - QQmlProperty property(object(), propertyName, context); + QQmlProperty property(object(), QString::fromUtf8(propertyName), context); if (!property.isValid()) return; @@ -256,7 +256,7 @@ void QQuickDesignerCustomObjectData::setPropertyBinding(QQmlContext *context, binding->update(); if (binding->hasError()) { if (property.property().userType() == QVariant::String) - property.write(QVariant(QString("#%1#").arg(expression))); + property.write(QVariant(QLatin1Char('#') + expression + QLatin1Char('#'))); } } else { diff --git a/src/quick/designer/qquickdesignersupportitems.cpp b/src/quick/designer/qquickdesignersupportitems.cpp index d5e848b2dc..4f23fe6630 100644 --- a/src/quick/designer/qquickdesignersupportitems.cpp +++ b/src/quick/designer/qquickdesignersupportitems.cpp @@ -59,8 +59,8 @@ static void stopAnimation(QObject *object) QQuickAbstractAnimation *animation = qobject_cast<QQuickAbstractAnimation*>(object); QQmlTimer *timer = qobject_cast<QQmlTimer*>(object); if (transition) { - transition->setFromState(""); - transition->setToState(""); + transition->setFromState(QString()); + transition->setToState(QString()); } else if (animation) { // QQuickScriptAction *scriptAimation = qobject_cast<QQuickScriptAction*>(animation); // if (scriptAimation) FIXME @@ -90,7 +90,7 @@ static void allSubObjects(QObject *object, QObjectList &objectList) if (metaProperty.isReadable() && metaProperty.isWritable() && QQmlMetaType::isQObject(metaProperty.userType())) { - if (metaProperty.name() != QLatin1String("parent")) { + if (qstrcmp(metaProperty.name(), "parent")) { QObject *propertyObject = QQmlMetaType::toQObject(metaProperty.read(object)); allSubObjects(propertyObject, objectList); } @@ -163,7 +163,7 @@ static bool isWindow(QObject *object) { static QQmlType *getQmlType(const QString &typeName, int majorNumber, int minorNumber) { - return QQmlMetaType::qmlType(typeName.toUtf8(), majorNumber, minorNumber); + return QQmlMetaType::qmlType(typeName, majorNumber, minorNumber); } static bool isCrashingType(QQmlType *type) @@ -220,7 +220,7 @@ QObject *QQuickDesignerSupportItems::createPrimitive(const QString &typeName, in if (!object) { qWarning() << "QuickDesigner: Cannot create an object of type" - << QString("%1 %2,%3").arg(typeName).arg(majorNumber).arg(minorNumber) + << QString::fromLatin1("%1 %2,%3").arg(typeName).arg(majorNumber).arg(minorNumber) << "- type isn't known to declarative meta type system"; } @@ -292,8 +292,9 @@ void QQuickDesignerSupportItems::disableTransition(QObject *object) { QQuickTransition *transition = qobject_cast<QQuickTransition*>(object); Q_ASSERT(transition); - transition->setToState("invalidState"); - transition->setFromState("invalidState"); + const QString invalidState = QLatin1String("invalidState"); + transition->setToState(invalidState); + transition->setFromState(invalidState); } void QQuickDesignerSupportItems::disableBehaivour(QObject *object) diff --git a/src/quick/designer/qquickdesignersupportmetainfo.cpp b/src/quick/designer/qquickdesignersupportmetainfo.cpp index 50441303c0..c6c7ed38b9 100644 --- a/src/quick/designer/qquickdesignersupportmetainfo.cpp +++ b/src/quick/designer/qquickdesignersupportmetainfo.cpp @@ -47,7 +47,7 @@ bool QQuickDesignerSupportMetaInfo::isSubclassOf(QObject *object, const QByteArr while (metaObject) { QQmlType *qmlType = QQmlMetaType::qmlType(metaObject); - if (qmlType && qmlType->qmlTypeName() == superTypeName) // ignore version numbers + if (qmlType && qmlType->qmlTypeName() == QLatin1String(superTypeName)) // ignore version numbers return true; if (metaObject->className() == superTypeName) diff --git a/src/quick/designer/qquickdesignersupportproperties.cpp b/src/quick/designer/qquickdesignersupportproperties.cpp index e471b0ef72..300ad6d53e 100644 --- a/src/quick/designer/qquickdesignersupportproperties.cpp +++ b/src/quick/designer/qquickdesignersupportproperties.cpp @@ -142,7 +142,7 @@ QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::propert QMetaProperty metaProperty = metaObject->property(index); QQmlProperty declarativeProperty(object, QLatin1String(metaProperty.name())); if (declarativeProperty.isValid() && !declarativeProperty.isWritable() && declarativeProperty.propertyTypeCategory() == QQmlProperty::Object) { - if (declarativeProperty.name() != "parent") { + if (declarativeProperty.name() != QLatin1String("parent")) { QObject *childObject = QQmlMetaType::toQObject(declarativeProperty.read()); if (childObject) propertyNameList.append(propertyNameListForWritableProperties(childObject, diff --git a/src/quick/designer/qquickdesignersupportpropertychanges.cpp b/src/quick/designer/qquickdesignersupportpropertychanges.cpp index 997582a28b..b8706fc880 100644 --- a/src/quick/designer/qquickdesignersupportpropertychanges.cpp +++ b/src/quick/designer/qquickdesignersupportpropertychanges.cpp @@ -88,7 +88,7 @@ void QQuickDesignerSupportPropertyChanges::changeValue(QObject *propertyChanges, if (!propertyChange) return; - propertyChange->changeValue(propertyName, value); + propertyChange->changeValue(QString::fromUtf8(propertyName), value); } void QQuickDesignerSupportPropertyChanges::changeExpression(QObject *propertyChanges, @@ -100,7 +100,7 @@ void QQuickDesignerSupportPropertyChanges::changeExpression(QObject *propertyCha if (!propertyChange) return; - propertyChange->changeExpression(propertyName, expression); + propertyChange->changeExpression(QString::fromUtf8(propertyName), expression); } QObject *QQuickDesignerSupportPropertyChanges::stateObject(QObject *propertyChanges) diff --git a/src/quick/designer/qquickdesignersupportstates.cpp b/src/quick/designer/qquickdesignersupportstates.cpp index 2b4fc97fac..b75ec7115a 100644 --- a/src/quick/designer/qquickdesignersupportstates.cpp +++ b/src/quick/designer/qquickdesignersupportstates.cpp @@ -47,7 +47,7 @@ bool QQuickDesignerSupportStates::isStateActive(QObject *object, QQmlContext *co QQuickStateGroup *stateGroup = stateObject->stateGroup(); - QQmlProperty property(object, "name", context); + QQmlProperty property(object, QLatin1String("name"), context); return stateObject && stateGroup && stateGroup->state() == property.read(); } @@ -61,7 +61,7 @@ void QQuickDesignerSupportStates::activateState(QObject *object, QQmlContext *co QQuickStateGroup *stateGroup = stateObject->stateGroup(); - QQmlProperty property(object, "name", context); + QQmlProperty property(object, QLatin1String("name"), context); stateGroup->setState(property.read().toString()); } |