summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecomponent.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-10 00:00:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-10 00:00:42 (GMT)
commita6b3fdccab1a4d3ed941ba069dc632aa9c8dc755 (patch)
tree0fe99363fe005f277edd71ec2722299d5bcec6b2 /src/declarative/qml/qdeclarativecomponent.cpp
parentc74455ffd68c2707502250126e77abc59b855172 (diff)
parent858e01e954ac9f3203ada6b61b47c418cc4b0a82 (diff)
downloadQt-a6b3fdccab1a4d3ed941ba069dc632aa9c8dc755.zip
Qt-a6b3fdccab1a4d3ed941ba069dc632aa9c8dc755.tar.gz
Qt-a6b3fdccab1a4d3ed941ba069dc632aa9c8dc755.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Remove unused struct update Browser.qml to run again Update Autotests Probably fix compile on windows Fix typo in docs Probably fix compile Fix qdeclarativevaluetype::font() autotest Initialize member variable in QDeclarativeGridViewAttached Handle itemsInserted/Removed/Moved() correctly for repeater. Add QML support for methods returning QList<QObject *> Compile Update configure.exe to include declarative module by default Make QDeclarativeItem NOTIFY signals canonical Integrate QML's object ownership with the JS collector Remove unused data member. Fix warning. Fix warnings and change geometry-related functions to use reals. When flicking with snap, bias towards moving at least one item. Doc fix.
Diffstat (limited to 'src/declarative/qml/qdeclarativecomponent.cpp')
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index d6bb216..d3608c4 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -512,7 +512,6 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
{
}
-
/*!
\internal
A version of create which returns a scriptObject, for use in script
@@ -526,7 +525,9 @@ QScriptValue QDeclarativeComponent::createObject()
return QScriptValue();
}
QObject* ret = create(ctxt);
- return QDeclarativeEnginePrivate::qmlScriptObject(ret, d->engine);
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine);
+ QDeclarativeDeclarativeData::get(ret, true)->setImplicitDestructible();
+ return priv->objectClass->newQObject(ret, QMetaType::QObjectStar);
}
/*!
@@ -541,7 +542,12 @@ QObject *QDeclarativeComponent::create(QDeclarativeContext *context)
{
Q_D(QDeclarativeComponent);
- return d->create(context, QBitField());
+ if (!context)
+ context = d->engine->rootContext();
+
+ QObject *rv = beginCreate(context);
+ completeCreate();
+ return rv;
}
QObject *QDeclarativeComponentPrivate::create(QDeclarativeContext *context,
@@ -586,7 +592,13 @@ QObject *QDeclarativeComponentPrivate::create(QDeclarativeContext *context,
QObject *QDeclarativeComponent::beginCreate(QDeclarativeContext *context)
{
Q_D(QDeclarativeComponent);
- return d->beginCreate(context, QBitField());
+ QObject *rv = d->beginCreate(context, QBitField());
+ if (rv) {
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(rv);
+ Q_ASSERT(ddata);
+ ddata->indestructible = true;
+ }
+ return rv;
}
QObject *