summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxborderimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx/qfxborderimage.cpp')
-rw-r--r--src/declarative/fx/qfxborderimage.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp
index 8f98a11..f1574e5 100644
--- a/src/declarative/fx/qfxborderimage.cpp
+++ b/src/declarative/fx/qfxborderimage.cpp
@@ -138,6 +138,15 @@ QFxBorderImage::~QFxBorderImage()
The URL may be absolute, or relative to the URL of the component.
*/
+static QString toLocalFileOrQrc(const QUrl& url)
+{
+ QString r = url.toLocalFile();
+ if (r.isEmpty() && url.scheme() == QLatin1String("qrc"))
+ r = QLatin1Char(':') + url.path();
+ return r;
+}
+
+
void QFxBorderImage::setSource(const QUrl &url)
{
Q_D(QFxBorderImage);
@@ -180,8 +189,9 @@ void QFxBorderImage::setSource(const QUrl &url)
d->status = Loading;
if (d->url.path().endsWith(QLatin1String(".sci"))) {
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
- if (d->url.scheme() == QLatin1String("file")) {
- QFile file(d->url.toLocalFile());
+ QString lf = toLocalFileOrQrc(d->url);
+ if (!lf.isEmpty()) {
+ QFile file(lf);
file.open(QIODevice::ReadOnly);
setGridScaledImage(QFxGridScaledImage(&file));
} else