Commit 2764ed4f authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.ItemLibrary: fixing creation of images



Since we do support Qt Quick 1, Qt Quick 1.1 and Qt Quick 2.0
this code has to be version agnostic.

Change-Id: I3386c78798f7a3b99f2c60b2af3c1082eef9bafd
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent d2bb1fb8
......@@ -45,6 +45,7 @@
#include "rewriterview.h"
#include "plaintexteditmodifier.h"
#include "modelmerger.h"
#include "nodemetainfo.h"
#include <utils/qtcassert.h>
......@@ -110,7 +111,7 @@ QmlItemNode QmlModelView::createQmlItemNodeFromImage(const QString &imageName, c
RewriterTransaction transaction = beginRewriterTransaction();
{
const QString newImportUrl = QLatin1String("QtQuick");
const QString newImportVersion = QLatin1String("1.0");
const QString newImportVersion = QLatin1String("1.1");
Import newImport = Import::createLibraryImport(newImportUrl, newImportVersion);
foreach (const Import &import, model()->imports()) {
......@@ -140,7 +141,7 @@ QmlItemNode QmlModelView::createQmlItemNodeFromImage(const QString &imageName, c
}
propertyPairList.append(qMakePair(QString("source"), QVariant(relativeImageName)));
newNode = createQmlItemNode("QtQuick.Image", 1, 0, propertyPairList);
newNode = createQmlItemNode("QtQuick.Image", -1, -1, propertyPairList);
parentNode.nodeAbstractProperty("data").reparentHere(newNode);
Q_ASSERT(newNode.isValid());
......
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