summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontext.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-14 04:26:32 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-14 04:26:32 (GMT)
commit799380ea82ced8cc5eb4eed5b1306748125331fa (patch)
tree41140bd1687211ae305f7b0e0f1cd2d413db3c94 /src/declarative/qml/qmlcontext.cpp
parenta093c5ef65aa2c28f52f78c8be5bbe7d567646fa (diff)
parent59b3e3ba52891197510115f912e7934ac1784d7c (diff)
downloadQt-799380ea82ced8cc5eb4eed5b1306748125331fa.zip
Qt-799380ea82ced8cc5eb4eed5b1306748125331fa.tar.gz
Qt-799380ea82ced8cc5eb4eed5b1306748125331fa.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts: src/declarative/qml/parser/qmljsparser.cpp
Diffstat (limited to 'src/declarative/qml/qmlcontext.cpp')
-rw-r--r--src/declarative/qml/qmlcontext.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index e97d2e9..980e1df 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -54,8 +54,8 @@
QT_BEGIN_NAMESPACE
QmlContextPrivate::QmlContextPrivate()
-: parent(0), engine(0), notifyIndex(-1), highPriorityCount(0),
- startLine(-1), endLine(-1)
+: parent(0), engine(0), isInternal(false), notifyIndex(-1),
+ highPriorityCount(0), startLine(-1), endLine(-1)
{
}
@@ -212,7 +212,7 @@ void QmlContextPrivate::addDefaultObject(QObject *object, Priority priority)
*/
/*! \internal */
-QmlContext::QmlContext(QmlEngine *e)
+QmlContext::QmlContext(QmlEngine *e, bool)
: QObject(*(new QmlContextPrivate))
{
Q_D(QmlContext);
@@ -221,6 +221,20 @@ QmlContext::QmlContext(QmlEngine *e)
}
/*!
+ Create a new QmlContext as a child of \a engine's root context, and the
+ QObject \a parent.
+*/
+QmlContext::QmlContext(QmlEngine *engine, QObject *parent)
+: QObject(*(new QmlContextPrivate), parent)
+{
+ Q_D(QmlContext);
+ QmlContext *parentContext = engine?engine->rootContext():0;
+ d->parent = parentContext;
+ d->engine = parentContext->engine();
+ d->init();
+}
+
+/*!
Create a new QmlContext with the given \a parentContext, and the
QObject \a parent.
*/
@@ -234,6 +248,19 @@ QmlContext::QmlContext(QmlContext *parentContext, QObject *parent)
}
/*!
+ \internal
+*/
+QmlContext::QmlContext(QmlContext *parentContext, QObject *parent, bool)
+: QObject(*(new QmlContextPrivate), parent)
+{
+ Q_D(QmlContext);
+ d->parent = parentContext;
+ d->engine = parentContext->engine();
+ d->isInternal = true;
+ d->init();
+}
+
+/*!
Destroys the QmlContext.
Any expressions, or sub-contexts dependent on this context will be