forked from qt-creator/qt-creator
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: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user