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

qmllint does not use qmltypes file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • 6.3
    • 6.3
    • QML: Tooling

    Description

      qmllint built from 00ffca0a65f81071f07d9094c4189a2bb448a64e report such error:

       /usr/local/qt6_tools/bin/qmllint -i ./cpp.qmltypes test.qml
      Warning: test.qml:7:32: Property "objectName" not found on type "CppObjects"
              console.log(CppObjects.objectName);
                                     ^^^^^^^^^^
      

      While stable qmllint (based on a1c91787264f6f535b5cf094b57ee53058856df4) reports no error, but if I change CppObjects.objectName to CppObjects.xyz it reports error. So a1c91787264f6f535b5cf094b57ee53058856df4 parses and uses qmltypes correctly.

      test.qml:

      import QtQuick 2.15
      import QtQml 2.15
      import CppClasses 1.0
      
      Item {
          Component.onCompleted: {
              console.log(CppObjects.objectName);
          }
      }
      

      and cpp.qmltypes:

      import QtQuick.tooling 1.2
      
      Module {
              Component {
                      name: "CppObjects"
                      prototype: "QObject"
                      exports: ["CppClasses/CppObjects 1.0"]
                      Property { name: "objectName"; type: "QString" }
              }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtqmlteam Qt Qml Team User
            evgeniy_dushistov evgeniy_dushistov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes