summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeloader.cpp
diff options
context:
space:
mode:
authorJanne Koskinen <janne.p.koskinen@digia.com>2010-04-23 14:08:48 (GMT)
committerJanne Koskinen <janne.p.koskinen@digia.com>2010-04-23 14:08:48 (GMT)
commitfecce960a050ef2964e28f373bf1a35f7d9949a3 (patch)
tree296ef35071a80076a5186e71696cddc88cc1a56f /src/declarative/graphicsitems/qdeclarativeloader.cpp
parent02c65146610cdd5bfe1f3ee4656ba07af82afcc7 (diff)
parent15088d236924bccee787953e04214f87392e8e55 (diff)
downloadQt-fecce960a050ef2964e28f373bf1a35f7d9949a3.zip
Qt-fecce960a050ef2964e28f373bf1a35f7d9949a3.tar.gz
Qt-fecce960a050ef2964e28f373bf1a35f7d9949a3.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-webkit into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeloader.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 409c228..bdd2c87 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -132,12 +132,15 @@ void QDeclarativeLoaderPrivate::initResize()
\endcode
If the Loader source is changed, any previous items instantiated
- will be destroyed. Setting \c source to an empty string
+ will be destroyed. Setting \c source to an empty string, or setting
+ sourceComponent to \e undefined
will destroy the currently instantiated items, freeing resources
and leaving the Loader empty. For example:
\code
pageLoader.source = ""
+ or
+ pageLoader.sourceComponent = undefined
\endcode
unloads "Page1.qml" and frees resources consumed by it.
@@ -271,13 +274,18 @@ void QDeclarativeLoader::setSourceComponent(QDeclarativeComponent *comp)
}
}
+void QDeclarativeLoader::resetSourceComponent()
+{
+ setSourceComponent(0);
+}
+
void QDeclarativeLoaderPrivate::_q_sourceLoaded()
{
Q_Q(QDeclarativeLoader);
if (component) {
if (!component->errors().isEmpty()) {
- qWarning() << component->errors();
+ QDeclarativeEnginePrivate::warning(qmlEngine(q), component->errors());
emit q->sourceChanged();
emit q->statusChanged();
emit q->progressChanged();
@@ -312,7 +320,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
}
} else {
if (!component->errors().isEmpty())
- qWarning() << component->errors();
+ QDeclarativeEnginePrivate::warning(qmlEngine(q), component->errors());
delete obj;
delete ctxt;
source = QUrl();
@@ -325,7 +333,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
}
/*!
- \qmlproperty enum Loader::status
+ \qmlproperty enumeration Loader::status
This property holds the status of QML loading. It can be one of:
\list
@@ -383,7 +391,7 @@ qreal QDeclarativeLoader::progress() const
}
/*!
- \qmlproperty enum Loader::resizeMode
+ \qmlproperty enumeration Loader::resizeMode
This property determines how the Loader or item are resized:
\list