summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-02-03 01:33:08 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-02-03 05:24:50 (GMT)
commit28093fa09de04d0633c261a91fd3746c107963fc (patch)
tree732f2beab2e91af65cf0ead92b3874437ddeadb9
parentb437255afe8348d0e5b865bd28cbf0500b3750f7 (diff)
parent9da60fd314e0a307a9247552e416ca09ac613dd2 (diff)
downloadQt-28093fa09de04d0633c261a91fd3746c107963fc.zip
Qt-28093fa09de04d0633c261a91fd3746c107963fc.tar.gz
Qt-28093fa09de04d0633c261a91fd3746c107963fc.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsloader.cpp10
-rw-r--r--src/declarative/qml/qmlobjectscriptclass.cpp6
-rw-r--r--src/declarative/qml/qmlobjectscriptclass_p.h4
-rw-r--r--src/declarative/qml/qmlscriptclass_p.h2
-rw-r--r--src/script/bridge/qscriptdeclarativeclass_p.h1
5 files changed, 15 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsloader.cpp b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
index bb1020c..7cd4d1a 100644
--- a/src/declarative/graphicsitems/qmlgraphicsloader.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
@@ -64,8 +64,14 @@ void QmlGraphicsLoaderPrivate::clear()
}
source = QUrl();
- delete item;
- item = 0;
+ if (item) {
+ // We can't delete immediately because our item may have triggered
+ // the Loader to load a different item.
+ item->setVisible(false);
+ static_cast<QGraphicsItem*>(item)->setParentItem(0);
+ item->deleteLater();
+ item = 0;
+ }
}
void QmlGraphicsLoaderPrivate::initResize()
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp
index d3c3ca5..4ff4746 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qmlobjectscriptclass.cpp
@@ -70,7 +70,7 @@ struct ObjectData : public QScriptDeclarativeClass::Object {
*/
QmlObjectScriptClass::QmlObjectScriptClass(QmlEngine *bindEngine)
: QmlScriptClass(QmlEnginePrivate::getScriptEngine(bindEngine)),
-#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2))
+#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
methods(bindEngine),
#endif
lastData(0), engine(bindEngine)
@@ -231,7 +231,7 @@ QmlObjectScriptClass::property(QObject *obj, const Identifier &name)
if (lastData->flags & QmlPropertyCache::Data::IsVMEFunction) {
return Value(scriptEngine, ((QmlVMEMetaObject *)(obj->metaObject()))->vmeMethod(lastData->coreIndex));
} else {
-#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2))
+#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
// Uncomment to use QtScript method call logic
// QScriptValue sobj = scriptEngine->newQObject(obj);
// return Value(scriptEngine, sobj.property(toString(name)));
@@ -444,7 +444,7 @@ QStringList QmlObjectScriptClass::propertyNames(Object *object)
return cache->propertyNames();
}
-#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2))
+#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
struct MethodData : public QScriptDeclarativeClass::Object {
MethodData(QObject *o, const QmlPropertyCache::Data &d) : object(o), data(d) {}
diff --git a/src/declarative/qml/qmlobjectscriptclass_p.h b/src/declarative/qml/qmlobjectscriptclass_p.h
index adb26b0..470c555 100644
--- a/src/declarative/qml/qmlobjectscriptclass_p.h
+++ b/src/declarative/qml/qmlobjectscriptclass_p.h
@@ -65,7 +65,7 @@ class QScriptContext;
class QScriptEngine;
class QmlContext;
-#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2))
+#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
class Q_AUTOTEST_EXPORT QmlObjectMethodScriptClass : public QScriptDeclarativeClass
{
public:
@@ -118,7 +118,7 @@ protected:
virtual QObject *toQObject(Object *, bool *ok = 0);
private:
-#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2))
+#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
QmlObjectMethodScriptClass methods;
#endif
diff --git a/src/declarative/qml/qmlscriptclass_p.h b/src/declarative/qml/qmlscriptclass_p.h
index 8064bdc..847ee66 100644
--- a/src/declarative/qml/qmlscriptclass_p.h
+++ b/src/declarative/qml/qmlscriptclass_p.h
@@ -66,7 +66,7 @@ public:
static QVariant toVariant(QmlEngine *, const QScriptValue &);
-#if (QT_VERSION <= QT_VERSION_CHECK(4, 6, 2))
+#if (QT_VERSION <= QT_VERSION_CHECK(4, 6, 2)) && !defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
struct Value : public QScriptValue {
Value() : QScriptValue() {}
Value(QScriptEngine *engine, int v) : QScriptValue(engine, v) {}
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index 357d1d5..a0fd6d5 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -47,6 +47,7 @@ class QScriptContext;
class Q_SCRIPT_EXPORT QScriptDeclarativeClass
{
public:
+#define QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE
class Q_SCRIPT_EXPORT Value
{
public: