Commit 4d76f0db authored by Marco Bubke's avatar Marco Bubke

QmlDesigner.NodeInstances: Remove QGraphicsObject for qml2

Change-Id: Ifcc81fa1dd01ab1f2c6d826e8ff438a8df577063
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 5442e745
......@@ -44,7 +44,6 @@ class QFileSystemWatcher;
class QQmlView;
class QQuickView;
class QQmlEngine;
class QGraphicsObject;
class QFileInfo;
class QQmlComponent;
QT_END_NAMESPACE
......
......@@ -43,10 +43,7 @@
#include <QFileInfo>
#include <QFileSystemWatcher>
#include <QPixmapCache>
#ifndef QT_NO_WEBKIT
#include <QGraphicsWebView>
#endif
#include <QGraphicsObject>
#include <QQuickItem>
#include <QTextDocument>
#include <QLibraryInfo>
......@@ -351,9 +348,9 @@ void ObjectNodeInstance::addToNewProperty(QObject *object, QObject *newParent, c
property.write(objectToVariant(object));
}
QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject*>(object);
QQuickItem *quickItem = qobject_cast<QQuickItem*>(object);
if (object && !(graphicsObject && graphicsObject->parentItem()))
if (object && !(quickItem && quickItem->parentItem()))
object->setParent(newParent);
Q_ASSERT(objectToVariant(object).isValid());
......@@ -783,25 +780,18 @@ void allSubObject(QObject *object, QObjectList &objectList)
allSubObject(childObject, objectList);
}
// search recursive in graphics item childItems list
QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject*>(object);
if (graphicsObject) {
foreach (QGraphicsItem *item, graphicsObject->childItems()) {
QGraphicsObject *childObject = item->toGraphicsObject();
allSubObject(childObject, objectList);
// search recursive in quick item childItems list
QQuickItem *quickItem = qobject_cast<QQuickItem*>(object);
if (quickItem) {
foreach (QQuickItem *childItem, quickItem->childItems()) {
allSubObject(childItem, objectList);
}
}
}
static void disableTiledBackingStore(QObject *object)
{
#ifndef QT_NO_WEBKIT
QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(object);
if (webView)
webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, false);
#else
Q_UNUSED(object);
#endif
}
QStringList propertyNameForWritableProperties(QObject *object, const QString &baseName = QString(), QObjectList *inspectedObjects = new QObjectList())
......@@ -1109,9 +1099,9 @@ QObject *ObjectNodeInstance::parent() const
QObject *parentObject(QObject *object)
{
QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject*>(object);
if (graphicsObject)
return graphicsObject->parentObject();
QQuickItem *quickItem = qobject_cast<QQuickItem*>(object);
if (quickItem)
return quickItem->parentItem();
return object->parent();
}
......
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