diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeloader.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeloader.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index b0499d7..6dbcd16 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -155,6 +155,8 @@ void QDeclarativeLoaderPrivate::initResize() QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeLoaderPrivate), parent) { + Q_D(QDeclarativeItem); + d->flags |= QGraphicsItem::ItemIsFocusScope; } /*! @@ -273,7 +275,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() if (component) { QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(q)); - ctxt->addDefaultObject(q); + ctxt->setContextObject(q); if (!component->errors().isEmpty()) { qWarning() << component->errors(); @@ -346,12 +348,13 @@ QDeclarativeLoader::Status QDeclarativeLoader::status() const } /*! - \qmlproperty real Loader::progress +\qmlproperty real Loader::progress - This property holds the progress of QML data loading, from 0.0 (nothing loaded) - to 1.0 (finished). +This property holds the progress of loading QML data from the network, from +0.0 (nothing loaded) to 1.0 (finished). Most QML files are quite small, so +this value will rapidly change from 0 to 1. - \sa status +\sa status */ qreal QDeclarativeLoader::progress() const { |