summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfximage.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-06-10 04:57:51 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-06-10 04:57:51 (GMT)
commit4dc4cfac667389efda4a43df5ff8cfa4ba305a2f (patch)
tree5c937ab2e510edb7a359b225132544d938a884a9 /src/declarative/fx/qfximage.cpp
parent29496148abe8506fbf50c99e9a210095c5115a14 (diff)
downloadQt-4dc4cfac667389efda4a43df5ff8cfa4ba305a2f.zip
Qt-4dc4cfac667389efda4a43df5ff8cfa4ba305a2f.tar.gz
Qt-4dc4cfac667389efda4a43df5ff8cfa4ba305a2f.tar.bz2
Support URLs directly (not just as strings), so they are correctly resolved.
URLs expressed as strings (possible relative) are resolved relative to the component in which the string expression is converted to a url value. All items are converted to use QUrl properties, except SqlConnection, where the databasename is only a special-case URL (this may need further consideration).
Diffstat (limited to 'src/declarative/fx/qfximage.cpp')
-rw-r--r--src/declarative/fx/qfximage.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index 224c25e..05738e3 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -825,19 +825,19 @@ qreal QFxImage::progress() const
The content specified can be of any image type loadable by QImage. Alternatively,
you can specify an sci format file, which specifies both an image and it's scale grid.
*/
-QString QFxImage::source() const
+QUrl QFxImage::source() const
{
Q_D(const QFxImage);
- return d->source;
+ return d->url;
}
-void QFxImage::setSource(const QString &url)
+void QFxImage::setSource(const QUrl &url)
{
#ifdef Q_ENABLE_PERFORMANCE_LOG
QFxPerfTimer<QFxPerf::PixmapLoad> perf;
#endif
Q_D(QFxImage);
- if (url == d->source)
+ if (url == d->url)
return;
if (d->sciReply) {
@@ -850,8 +850,7 @@ void QFxImage::setSource(const QString &url)
if (!d->sciurl.isEmpty())
QFxPixmap::cancelGet(d->sciurl, this);
- d->source = url;
- d->url = qmlContext(this)->resolvedUrl(url);
+ d->url = url;
d->sciurl = QUrl();
if (d->progress != 0.0) {
d->progress = 0.0;
@@ -872,7 +871,7 @@ void QFxImage::setSource(const QString &url)
}
#endif
emit statusChanged(d->status);
- emit sourceChanged(d->source);
+ emit sourceChanged(d->url);
emit progressChanged(1.0);
update();
} else {
@@ -936,7 +935,7 @@ void QFxImage::requestFinished()
}
#endif
emit statusChanged(d->status);
- emit sourceChanged(d->source);
+ emit sourceChanged(d->url);
emit progressChanged(1.0);
update();
}