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

qmllint should warn about possible type confusion from differnt imports

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • 6.12
    • None
    • QML: Tooling
    • None

      // MapType.qml
      pragma Singleton
      import QtQml
      
      QtObject {
          readonly property int map: 1
      }
      // Main.qml
      import QtLocation
      
      QtObject {
          // MapType from MapType.qml above is in implicit import
          // but MapType from QtLocation takes precedence
          property int mapType: MapType.map
      }

      qmllint could warn the user about such a situation where they might not realize that QtLocation exposes a type called MapType that hides their own type of the same name.

       

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

            qtqmlteam Qt Qml Team User
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes