Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31614

QQmlEngine::imageProvider() and removeImageProvider() is case-inssensitive

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.0.2
    • None
    • Ubuntu Saucy Salamander 64bit

      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.

        1. main.cpp
          0.9 kB
        2. main.pro
          0.1 kB
        3. qqmlengine.cpp.patch
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            aalpert Alan Alpert
            m_shibata Mitsuya Shibata
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes