diff options
author | hjk <hjk@theqtcompany.com> | 2016-03-18 10:19:09 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@theqtcompany.com> | 2016-03-18 14:17:04 +0000 |
commit | 49735ee5ee4491668e66f7c35db71dd1f998d988 (patch) | |
tree | fd3f6e724c492f54ae79388eaca7aef6a04c9d25 /share/qtcreator | |
parent | ca21ac52c3e855598f6c804fcf615f1259e59b30 (diff) |
QmlPuppet: Make compile without QT_RESTRICTED_CAST_FROM_ASCII removed
Change-Id: I535efad65b2224337c133463da075953cc878c6c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Diffstat (limited to 'share/qtcreator')
9 files changed, 28 insertions, 29 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp index 577374b8c5..11ea5721b9 100644 --- a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp @@ -295,7 +295,8 @@ void SharedMemory::setErrorString(const QString &function) m_error = QSharedMemory::OutOfResources; break; default: - m_errorString = QStringLiteral("%1: unknown error %2").arg(function).arg(strerror(errno)); + m_errorString = QStringLiteral("%1: unknown error %2") + .arg(function).arg(QString::fromLocal8Bit(strerror(errno))); m_error = QSharedMemory::UnknownError; } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index f475ca338a..908cc0695b 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -821,7 +821,7 @@ void NodeInstanceServer::resetInstanceProperty(const PropertyAbstractContainer & } if (propertyContainer.isDynamic() && propertyContainer.instanceId() == 0 && engine()) - rootContext()->setContextProperty(name, QVariant()); + rootContext()->setContextProperty(QString::fromUtf8(name), QVariant()); } } @@ -839,12 +839,14 @@ void NodeInstanceServer::setInstancePropertyBinding(const PropertyBindingContain bool stateBindingWasUpdated = activeStateInstance().updateStateBinding(instance, name, expression); if (!stateBindingWasUpdated) { if (bindingContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), + QString::fromUtf8(name)); instance.setPropertyBinding(name, expression); } } else { if (bindingContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), + QString::fromUtf8(name)); instance.setPropertyBinding(name, expression); } } @@ -871,17 +873,17 @@ void NodeInstanceServer::setInstancePropertyVariant(const PropertyValueContainer bool stateValueWasUpdated = activeStateInstance().updateStateVariant(instance, name, value); if (!stateValueWasUpdated) { if (valueContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), QString::fromUtf8(name)); instance.setPropertyVariant(name, value); } } else { //base state if (valueContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), QString::fromUtf8(name)); instance.setPropertyVariant(name, value); } if (valueContainer.isDynamic() && valueContainer.instanceId() == 0 && engine()) - rootContext()->setContextProperty(name, Internal::QmlPrivateGate::fixResourcePaths(value)); + rootContext()->setContextProperty(QString::fromUtf8(name), Internal::QmlPrivateGate::fixResourcePaths(value)); } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index 14c8aff660..1b85d8655e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -301,7 +301,7 @@ static void removeObjectFromList(const QQmlProperty &property, QObject *objectTo void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldParent, const PropertyName &oldParentProperty) { - QQmlProperty property(oldParent, oldParentProperty, context()); + QQmlProperty property(oldParent, QString::fromUtf8(oldParentProperty), context()); if (!property.isValid()) return; @@ -320,7 +320,7 @@ void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldPare void ObjectNodeInstance::addToNewProperty(QObject *object, QObject *newParent, const PropertyName &newParentProperty) { - QQmlProperty property(newParent, newParentProperty, context()); + QQmlProperty property(newParent, QString::fromUtf8(newParentProperty), context()); if (object) object->setParent(newParent); @@ -400,7 +400,7 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar if (ignoredProperties().contains(name)) return; - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (!property.isValid()) return; @@ -482,7 +482,7 @@ void ObjectNodeInstance::resetProperty(const PropertyName &name) void ObjectNodeInstance::refreshProperty(const PropertyName &name) { - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (!property.isValid()) return; @@ -523,7 +523,7 @@ QVariant ObjectNodeInstance::property(const PropertyName &name) const if (QmlPrivateGate::isPropertyBlackListed(name)) return QVariant(); - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (property.property().isEnumType()) { QVariant value = property.read(); return property.property().enumerator().valueToKey(value.toInt()); @@ -555,10 +555,10 @@ QString ObjectNodeInstance::instanceType(const PropertyName &name) const if (QmlPrivateGate::isPropertyBlackListed(name)) return QLatin1String("undefined"); - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (!property.isValid()) return QLatin1String("undefined"); - return property.propertyTypeName(); + return QString::fromUtf8(property.propertyTypeName()); } QList<ServerNodeInstance> ObjectNodeInstance::childItems() const diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index ae53e1f4d3..9e0461ba29 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -152,10 +152,8 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() foreach (const InstancePropertyPair& property, changedPropertyList()) { const ServerNodeInstance instance = property.first; - const QString propertyName = property.second; - if (instance.isValid()) { - if (propertyName.contains("anchors")) + if (property.second.contains("anchors")) informationChangedInstanceSet.insert(instance); propertyChangedList.append(property); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp index 44d361f8f8..ec90f0ce63 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp @@ -276,10 +276,8 @@ void QmlDesigner::Qt5TestNodeInstanceServer::collectItemChangesAndSendChangeComm foreach (const InstancePropertyPair& property, changedPropertyList()) { const ServerNodeInstance instance = property.first; - const QString propertyName = property.second; - if (instance.isValid()) { - if (propertyName.contains("anchors")) + if (property.second.contains("anchors")) informationChangedInstanceSet.insert(instance); propertyChangedList.append(property); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp index 2a3420a3da..0014def3b0 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp @@ -690,7 +690,7 @@ void QuickItemNodeInstance::resetProperty(const PropertyName &name) if (name == "y") m_y = 0.0; - DesignerSupport::resetAnchor(quickItem(), name); + DesignerSupport::resetAnchor(quickItem(), QString::fromUtf8(name)); if (name == "anchors.fill") { resetHorizontal(); @@ -727,7 +727,7 @@ bool QuickItemNodeInstance::isAnchoredByChildren() const bool QuickItemNodeInstance::hasAnchor(const PropertyName &name) const { - return DesignerSupport::hasAnchor(quickItem(), name); + return DesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name)); } static bool isValidAnchorName(const PropertyName &name) @@ -747,10 +747,11 @@ static bool isValidAnchorName(const PropertyName &name) QPair<PropertyName, ServerNodeInstance> QuickItemNodeInstance::anchor(const PropertyName &name) const { - if (!isValidAnchorName(name) || !DesignerSupport::hasAnchor(quickItem(), name)) + if (!isValidAnchorName(name) || !DesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name))) return ObjectNodeInstance::anchor(name); - QPair<QString, QObject*> nameObjectPair = DesignerSupport::anchorLineTarget(quickItem(), name, context()); + QPair<QString, QObject*> nameObjectPair = + DesignerSupport::anchorLineTarget(quickItem(), QString::fromUtf8(name), context()); QObject *targetObject = nameObjectPair.second; PropertyName targetName = nameObjectPair.first.toUtf8(); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp index 155aeb4aad..a87dc4a2f7 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp @@ -205,7 +205,7 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe if (object == 0) nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QString("Component with path %1 could not be created.").arg(instanceContainer.componentPath()), instanceContainer.instanceId()); } else { - object = Internal::ObjectNodeInstance::createPrimitive(instanceContainer.type(), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context()); + object = Internal::ObjectNodeInstance::createPrimitive(QString::fromUtf8(instanceContainer.type()), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context()); if (object == 0) nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QLatin1String("Item could not be created."), instanceContainer.instanceId()); } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri index 734775f780..954596d16e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri @@ -20,7 +20,6 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH) SOURCES += $$PWD/qml2puppetmain.cpp RESOURCES += $$PWD/../qmlpuppet.qrc -DEFINES -= QT_RESTRICTED_CAST_FROM_ASCII DISTFILES += Info.plist diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp index b255fb77c8..8edf669365 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp @@ -94,7 +94,7 @@ QVariant fixResourcePaths(const QVariant &value) const QUrl url = value.toUrl(); if (url.scheme() == QLatin1String("qrc")) { const QString path = QLatin1String("qrc:") + url.path(); - QString qrcSearchPath = qgetenv("QMLDESIGNER_RC_PATHS"); + QString qrcSearchPath = QString::fromLocal8Bit(qgetenv("QMLDESIGNER_RC_PATHS")); if (!qrcSearchPath.isEmpty()) { const QStringList searchPaths = qrcSearchPath.split(QLatin1Char(';')); foreach (const QString &qrcPath, searchPaths) { @@ -115,7 +115,7 @@ QVariant fixResourcePaths(const QVariant &value) if (value.type() == QVariant::String) { const QString str = value.toString(); if (str.contains(QLatin1String("qrc:"))) { - QString qrcSearchPath = qgetenv("QMLDESIGNER_RC_PATHS"); + QString qrcSearchPath = QString::fromLocal8Bit(qgetenv("QMLDESIGNER_RC_PATHS")); if (!qrcSearchPath.isEmpty()) { const QStringList searchPaths = qrcSearchPath.split(QLatin1Char(';')); foreach (const QString &qrcPath, searchPaths) { @@ -168,7 +168,7 @@ QVariant getResetValue(QObject *object, const PropertyName &propertyName) static void setProperty(QObject *object, QQmlContext *context, const PropertyName &propertyName, const QVariant &value) { - QQmlProperty property(object, propertyName, context); + QQmlProperty property(object, QString::fromUtf8(propertyName), context); property.write(value); } |