diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-02-04 04:11:09 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2011-02-04 04:11:09 (GMT) |
commit | 9f8a181a619649c8a227e92f3d16677f4b7cb30a (patch) | |
tree | fdad9e918eaee28aecd7fc8f4a710df5d6dd5d4c /src/declarative/qml | |
parent | d87e2627cbc3f818e23c9c80b03cc665e5f3d444 (diff) | |
download | Qt-9f8a181a619649c8a227e92f3d16677f4b7cb30a.zip Qt-9f8a181a619649c8a227e92f3d16677f4b7cb30a.tar.gz Qt-9f8a181a619649c8a227e92f3d16677f4b7cb30a.tar.bz2 |
Clarify case preservation in QDeclarativeImageProviders
Task-number: QTBUG-15905
Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeimageprovider.cpp | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 890f500..37df226 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -776,7 +776,7 @@ void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativ { Q_D(QDeclarativeEngine); QMutexLocker locker(&d->mutex); - d->imageProviders.insert(providerId, QSharedPointer<QDeclarativeImageProvider>(provider)); + d->imageProviders.insert(providerId.toLower(), QSharedPointer<QDeclarativeImageProvider>(provider)); } /*! diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index 560077f..f111c20 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -75,6 +75,16 @@ public: invokes the appropriate image provider according to the providers that have been registered through QDeclarativeEngine::addImageProvider(). + Note that the identifiers are case-insensitive, but the rest of the URL will be passed on with + preserved case. For example, the below snippet would still specify that the image is loaded by the + image provider named "myimageprovider", but it would request a different image than the above snippet + ("Image.png" instead of "image.png"). + \qml + Image { source: "image://MyImageProvider/Image.png" } + \endqml + + If you want the rest of the URL to be case insensitive, you will have to take care + of that yourself inside your image provider. \section2 An example |