Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.0.2
-
None
-
Ubuntu Saucy Salamander 64bit
Description
QQmlEngine::addImageProvider() register providerId as hash key with toLower() for case-insensitive[1].
However imageProvider() and removeProvider() search hash without toLower(), [2][3]
then this method is case-sensitive.
[1] https://qt.gitorious.org/qt/qtdeclarative/blobs/stable/src/qml/qml/qqmlengine.cpp#line1054
[2] https://qt.gitorious.org/qt/qtdeclarative/blobs/stable/src/qml/qml/qqmlengine.cpp#line1068
[3] https://qt.gitorious.org/qt/qtdeclarative/blobs/stable/src/qml/qml/qqmlengine.cpp#line1080
How to reproduce:
1. Download attached code.
2. qmake && make
3. ./test_qmlengine
This code call addImageProvider("TestProvider"),
then call imageProvider("TestProvider") - case-sensitive
and imageProvider("testprovider) - caes-insensitive
to find ImageProvider.
Expected result:
Case Sensitive: 0x87a290
tolower: 0x87a290
Both result should output valid address.
Actual result:
Case Sensitive: (nil)
tolower: 0x87a290
Only case-insensitve provider id output valid address.
How to resolve:
Use aloways toLower() as like added patch.
This patch is just suggestion, not tested.