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

lower case QML components are accepted when used with 'as' import

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 4.7.3, 4.7.4, 5.0.0
    • None
    • QtSDK:qtsdkinstaller-x32-2011-07-15-Ubuntu8.04.4LTS.run
      QtCreator:qtcreator-linux-x86-opensource-2.2.83-201107260106-setup.bin
      From revision 02aee9bdb0
      Ubuntu 10.10
      sdktestround17
    • Change-Id: Id4a0c0fdb0c9b9516bea597a4994bb7519339bc9

    Description

      The qtbug-20768.tgz shows the app working fine with qmlviewer main.qml. Certainly does not seem to be correct, going by the component naming convention.
      Changing the name of the file to Mypage.qml produces an error (Type Qml/Mypage unavailable)

      // main.qml
      import "liuli" as Qml
      ...
      
      Qml.mypage {
          ...
      } // Lower case "mypage", where the file is "liuli/mypage.qml"
      

      As expected, mypage

      { ... } and Mypage { ... }

      do not work with the lower case filename (Cannot assign to non-existent property "mypage"; Mypage is not a type).

      untitled38.zip shows that creator correctly recognises the type naming error.
      Reproduction steps:

      1. Create a Qt Quick application.
      2. Add a new directory and a new qml file named mypage.qml. See untitled38.zip in the attachment.
      3. Go to main.qml.
      4. Move the mouse over "Qml.mypage", the tip shows "unknow type" and a red wave under it, which indicate the "Qml.mypage" is not recognized. See page.png.
      5. Run the application, it works normally. The Qml.mypage can be recognized. So "Qml.mypage" should not be recognized as an "unknown type". See run.png.

      Attachments

        1. qtbug-20786.tgz
          0.4 kB
        2. page.png
          page.png
          84 kB
        3. run.png
          run.png
          6 kB
        4. untitled38.zip
          27 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mvogt Matthew Vogt (closed Nokia identity) (Inactive)
            liuuxlii Liu LI
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes