Commit ddc76416 authored by Kai Koehne's avatar Kai Koehne

Qml: Bump library version from 4.6 to 4.7

All types in the Qt namespace now have 4.7 as minimum version.
parent 1986a3c6
......@@ -4190,7 +4190,7 @@
\code
import Qt 4.6
import Qt 4.7
Rectangle {
width: 360
......
......@@ -261,10 +261,10 @@ QList<RewriterView::Error> DesignDocumentController::loadMaster(QPlainTextEdit *
//m_d->masterModel = Model::create(m_d->textModifier, m_d->searchPath, errors);
m_d->masterModel = Model::create("Qt/Rectangle", 4, 6);
m_d->masterModel = Model::create("Qt/Rectangle", 4, 7);
m_d->masterModel->setFileUrl(m_d->searchPath);
m_d->subComponentModel = Model::create("Qt/Rectangle", 4, 6);
m_d->subComponentModel = Model::create("Qt/Rectangle", 4, 7);
m_d->subComponentModel->setFileUrl(m_d->searchPath);
m_d->subComponentManager = new SubComponentManager(m_d->masterModel->metaInfo(), this);
......@@ -499,7 +499,7 @@ void DesignDocumentController::copySelected()
foreach (ModelNode node, view.rootModelNode().allDirectSubModelNodes()) {
node.destroy();
}
view.changeRootNodeType("Qt/Rectangle", 4, 6);
view.changeRootNodeType("Qt/Rectangle", 4, 7);
view.rootModelNode().setId("designer__Selection");
foreach (const ModelNode &selectedNode, selectedNodes) {
......
......@@ -102,7 +102,7 @@ QString DesignDocumentControllerView::toText() const
QScopedPointer<Model> outputModel(Model::create("Qt/Rectangle"));
outputModel->setMetaInfo(model()->metaInfo());
QPlainTextEdit textEdit;
textEdit.setPlainText("import Qt 4.6; Item {}");
textEdit.setPlainText("import Qt 4.7; Item {}");
NotIndentingTextEditModifier modifier(&textEdit);
QScopedPointer<RewriterView> rewriterView(new RewriterView(RewriterView::Amend, 0));
......@@ -125,7 +125,7 @@ void DesignDocumentControllerView::fromText(QString text)
inputModel->setMetaInfo(model()->metaInfo());
inputModel->setFileUrl(model()->fileUrl());
QPlainTextEdit textEdit;
QString imports("import Qt 4.6;\n");
QString imports("import Qt 4.7;\n");
textEdit.setPlainText(imports + text);
NotIndentingTextEditModifier modifier(&textEdit);
......
......@@ -151,15 +151,15 @@ void BehaviorDialog::accept()
m_modelNode.removeProperty(m_propertyName);
if (m_ui->comboBox->currentIndex() == 0) {
RewriterTransaction transaction(m_modelNode.view()->beginRewriterTransaction());
ModelNode Behavior = m_modelNode.view()->createModelNode("Qt/Behavior", 4, 6);
ModelNode Behavior = m_modelNode.view()->createModelNode("Qt/Behavior", 4, 7);
m_modelNode.nodeProperty(m_propertyName).reparentHere(Behavior);
ModelNode animation = m_modelNode.view()->createModelNode("Qt/NumberAnimation", 4, 6);
ModelNode animation = m_modelNode.view()->createModelNode("Qt/NumberAnimation", 4, 7);
animation.variantProperty("duration") = m_ui->duration->value();
animation.variantProperty("easing") = m_ui->curve->currentText();
Behavior.nodeProperty("animation").reparentHere(animation);
} else {
RewriterTransaction transaction(m_modelNode.view()->beginRewriterTransaction());
ModelNode springFollow = m_modelNode.view()->createModelNode("Qt/SpringFollow", 4, 6);
ModelNode springFollow = m_modelNode.view()->createModelNode("Qt/SpringFollow", 4, 7);
m_modelNode.nodeProperty(m_propertyName).reparentHere(springFollow);
springFollow.variantProperty("velocity") = m_ui->velocity->value();
springFollow.variantProperty("spring") = m_ui->spring->value();
......
......@@ -675,11 +675,11 @@ void GradientLine::updateGradient()
modelNode.removeProperty(m_gradientName);
}
ModelNode gradientNode = modelNode.view()->createModelNode("Qt/Gradient", 4, 6);
ModelNode gradientNode = modelNode.view()->createModelNode("Qt/Gradient", 4, 7);
for (int i = 0;i < m_stops.size(); i++) {
ModelNode gradientStopNode = modelNode.view()->createModelNode("Qt/GradientStop", 4, 6);
ModelNode gradientStopNode = modelNode.view()->createModelNode("Qt/GradientStop", 4, 7);
gradientStopNode.variantProperty("position") = roundReal(m_stops.at(i));
gradientStopNode.variantProperty("color") = normalizeColor(m_colorList.at(i));
gradientNode.nodeListProperty("stops").reparentHere(gradientStopNode);
......
......@@ -217,7 +217,7 @@ void PropertyEditor::NodeType::initialSetup(const QString &typeName, const QUrl
{
QDeclarativeContext *ctxt = m_view->rootContext();
NodeMetaInfo metaInfo = propertyEditor->model()->metaInfo().nodeMetaInfo(typeName, 4, 6);
NodeMetaInfo metaInfo = propertyEditor->model()->metaInfo().nodeMetaInfo(typeName, 4, 7);
foreach (const QString &propertyName, metaInfo.properties(true).keys())
setupPropertyEditorValue(propertyName, &m_backendValuesPropertyMap, propertyEditor, metaInfo.property(propertyName, true).type());
......@@ -615,7 +615,7 @@ void PropertyEditor::timerEvent(QTimerEvent *timerEvent)
QString templateGeneration(NodeMetaInfo type, NodeMetaInfo superType)
{
QString qmlTemplate = QLatin1String("import Qt 4.6\nimport Bauhaus 1.0\n");
QString qmlTemplate = QLatin1String("import Qt 4.7\nimport Bauhaus 1.0\n");
qmlTemplate += QLatin1String("GroupBox {\n");
qmlTemplate += QString(QLatin1String("caption: \"%1\"\n")).arg(type.typeName());
qmlTemplate += QLatin1String("layout: VerticalLayout {\n");
......
......@@ -275,7 +275,7 @@ void PropertyEditorNodeWrapper::add(const QString &type)
propertyType = m_editorValue->modelNode().metaInfo().property(m_editorValue->name()).type();
while (propertyType.contains('*')) //strip star
propertyType.chop(1);
m_modelNode = m_editorValue->modelNode().view()->createModelNode(propertyType, 4, 6);
m_modelNode = m_editorValue->modelNode().view()->createModelNode(propertyType, 4, 7);
m_editorValue->modelNode().nodeAbstractProperty(m_editorValue->name()).reparentHere(m_modelNode);
if (!m_modelNode.isValid()) {
qWarning("PropertyEditorNodeWrapper::add failed");
......
......@@ -136,29 +136,29 @@ Internal::ObjectNodeInstance::Pointer NodeInstance::createInstance(const NodeMet
instance = Internal::DummyNodeInstance::create();
else if (metaInfo.isSubclassOf("org.webkit/WebView", 1, 0))
instance = Internal::DummyNodeInstance::create();
else if (metaInfo.isSubclassOf("Qt/QWidget", 4, 6))
else if (metaInfo.isSubclassOf("Qt/QWidget", 4, 7))
instance = Internal::DummyNodeInstance::create();
else if (metaInfo.isSubclassOf("Qt/QGraphicsView", 4, 6))
else if (metaInfo.isSubclassOf("Qt/QGraphicsView", 4, 7))
instance = Internal::GraphicsViewNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/QDeclarativeView", 4, 6))
else if (metaInfo.isSubclassOf("Qt/QDeclarativeView", 4, 7))
instance = Internal::QDeclarativeViewNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/QGraphicsWidget", 4, 6))
else if (metaInfo.isSubclassOf("Qt/QGraphicsWidget", 4, 7))
instance = Internal::GraphicsWidgetNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/Item", 4, 6))
else if (metaInfo.isSubclassOf("Qt/Item", 4, 7))
instance = Internal::QmlGraphicsItemNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/QGraphicsScene", 4, 6))
else if (metaInfo.isSubclassOf("Qt/QGraphicsScene", 4, 7))
instance = Internal::GraphicsSceneNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/Component", 4, 6))
else if (metaInfo.isSubclassOf("Qt/Component", 4, 7))
instance = Internal::ComponentNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/PropertyChanges", 4, 6))
else if (metaInfo.isSubclassOf("Qt/PropertyChanges", 4, 7))
instance = Internal::QmlPropertyChangesNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/State", 4, 6))
else if (metaInfo.isSubclassOf("Qt/State", 4, 7))
instance = Internal::QmlStateNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/Transition", 4, 6))
else if (metaInfo.isSubclassOf("Qt/Transition", 4, 7))
instance = Internal::QmlTransitionNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/Behavior", 4, 6))
else if (metaInfo.isSubclassOf("Qt/Behavior", 4, 7))
instance = Internal::BehaviorNodeInstance::create(metaInfo, context, objectToBeWrapped);
else if (metaInfo.isSubclassOf("Qt/QtObject", 4, 6))
else if (metaInfo.isSubclassOf("Qt/QtObject", 4, 7))
instance = Internal::ObjectNodeInstance::create(metaInfo, context, objectToBeWrapped);
else
instance = Internal::DummyNodeInstance::create();
......
......@@ -44,7 +44,7 @@ ProxyWidgetNodeInstance::ProxyWidgetNodeInstance(QGraphicsProxyWidget *widget)
ProxyWidgetNodeInstance::Pointer ProxyWidgetNodeInstance::create(const QString &typeName)
{
QObject *object = QDeclarativeMetaType::qmlType(typeName.toLatin1(), 4, 6)->create();
QObject *object = QDeclarativeMetaType::qmlType(typeName.toLatin1(), 4, 7)->create();
Q_ASSERT(object);
if (object == 0)
return Pointer();
......
......@@ -87,7 +87,7 @@ namespace Internal {
ModelPrivate::ModelPrivate(Model *model) :
m_q(model),
m_rootInternalNode(createNode("Qt/Rectangle", 4, 6, PropertyListType())),
m_rootInternalNode(createNode("Qt/Rectangle", 4, 7, PropertyListType())),
m_writeLock(false)
{
}
......
......@@ -83,7 +83,7 @@ bool mustBeProxied(const ModelNode &child, const ModelNode &parent)
QVariant parseProperty(const QString &className, const QString &propertyName, const QString &value)
{
const QMetaObject *metaObject = QmlMetaType::qmlType(className.toAscii().constData(), 4, 6)->metaObject();
const QMetaObject *metaObject = QmlMetaType::qmlType(className.toAscii().constData(), 4, 7)->metaObject();
if (!metaObject) {
qWarning() << "Type " << className << "is unknown to the Qml type system";
return QVariant();
......
......@@ -51,12 +51,12 @@ void QmlModelStateOperation::setTarget(const ModelNode &target)
bool QmlPropertyChanges::isValid() const
{
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isSubclassOf("Qt/PropertyChanges", 4, 6);
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isSubclassOf("Qt/PropertyChanges", 4, 7);
}
bool QmlModelStateOperation::isValid() const
{
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isSubclassOf("QDeclarativeStateOperation", 4, 6);
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isSubclassOf("QDeclarativeStateOperation", 4, 7);
}
void QmlPropertyChanges::removeProperty(const QString &name)
......
......@@ -45,7 +45,7 @@ namespace QmlDesigner {
bool QmlItemNode::isValid() const
{
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().isSubclassOf("Qt/Item", 4, 6);
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().isSubclassOf("Qt/Item", 4, 7);
}
bool QmlItemNode::isRootNode() const
......@@ -269,7 +269,7 @@ QmlModelState QmlModelStateGroup::addState(const QString &name)
PropertyListType propertyList;
propertyList.append(qMakePair(QString("name"), QVariant(name)));
ModelNode newState = modelNode().view()->createModelNode("Qt/State", 4, 6, propertyList);
ModelNode newState = modelNode().view()->createModelNode("Qt/State", 4, 7, propertyList);
modelNode().nodeListProperty("states").reparentHere(newState);
return newState;
......
......@@ -105,7 +105,7 @@ QmlItemNode QmlModelView::createQmlItemNodeFromImage(const QString &imageName, c
}
propertyPairList.append(qMakePair(QString("source"), QVariant(relativeImageName)));
newNode = createQmlItemNode("Qt/Image",4, 6, propertyPairList);
newNode = createQmlItemNode("Qt/Image",4, 7, propertyPairList);
parentNode.nodeAbstractProperty("data").reparentHere(newNode);
Q_ASSERT(newNode.isValid());
......
......@@ -178,7 +178,7 @@ void QmlModelState::addChangeSetIfNotExists(const ModelNode &node)
return; //changeSet already there
}
ModelNode newChangeSet = modelNode().view()->createModelNode("Qt/PropertyChanges", 4, 6);
ModelNode newChangeSet = modelNode().view()->createModelNode("Qt/PropertyChanges", 4, 7);
modelNode().nodeListProperty("changes").reparentHere(newChangeSet);
QmlPropertyChanges(newChangeSet).setTarget(node);
......@@ -229,7 +229,7 @@ bool QmlModelState::isValid() const
{
return QmlModelNodeFacade::isValid() &&
modelNode().metaInfo().isValid() &&
(modelNode().metaInfo().isSubclassOf("Qt/State", 4, 6) || isBaseState());
(modelNode().metaInfo().isSubclassOf("Qt/State", 4, 7) || isBaseState());
}
/**
......@@ -263,7 +263,7 @@ QmlModelState QmlModelState::duplicate(const QString &name) const
// QmlModelState newState(stateGroup().addState(name));
PropertyListType propertyList;
propertyList.append(qMakePair(QString("name"), QVariant(name)));
QmlModelState newState ( qmlModelView()->createModelNode("Qt/State", 4, 6, propertyList) );
QmlModelState newState ( qmlModelView()->createModelNode("Qt/State", 4, 7, propertyList) );
foreach (const ModelNode &childNode, modelNode().nodeListProperty("changes").toModelNodeList()) {
ModelNode newModelNode(qmlModelView()->createModelNode(childNode.type(), childNode.majorVersion(), childNode.minorVersion()));
......
......@@ -38,8 +38,8 @@ namespace QmlDesigner {
FxPlugin::FxPlugin()
{
qmlRegisterType<QDeclarativePen>("Qt",4,6,"Pen");
qmlRegisterType<QDeclarativeScaleGrid>("Qt",4,6,"ScaleGrid");
qmlRegisterType<QDeclarativePen>("Qt", 4, 7, "Pen");
qmlRegisterType<QDeclarativeScaleGrid>("Qt", 4, 7, "ScaleGrid");
}
QString FxPlugin::pluginName()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment