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

Declared alias import not found

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.3.0 RC
    • Fix Version/s: 6.4.0 Beta1, 6.4
    • Component/s: QML: Compiler
    • Labels:
    • Platform/s:
      All
    • Commits:
      0b63f3b66d (qt/qtdeclarative/dev) 0b63f3b66d (qt/tqtc-qtdeclarative/dev)

      Description

      Code with an aliased import like

      import QtQuick
      import msg as MSG
      
      Window {
          id: win
          property MSG.Message message: MSG.Message{}
      
          Component.onCompleted: {
              console.log(win.message.count)
          }
      }
      

      results in four warnings

      Warning: main.qml:11:5: MSG was not found. Did you add all import paths?
          property MSG.Message message: MSG.Message{}
          ^^^^^^^^
      Warning: main.qml:11:26: Property "message" has incomplete type "MSG". You may be missing an import.
          property MSG.Message message: MSG.Message{}
                               ^^^^^^^
      Warning: main.qml:14:25: Type "MSG" of property "message" not found. This is likely due to a missing dependency entry or a type not being exposed declaratively.
              console.log(win.message.count)
                              ^^^^^^^
      Warning: main.qml:14:25: Could not compile binding for onCompleted: Cannot load property message from QQuickWindowQmlImpl of .
              console.log(win.message.count)
                              ^^^^^^^
      

      claiming that MSG is undefined. But it is, and the created executable works fine.

      This creates loads of follow up messages in all places where the type is referenced.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              ulherman Ulf Hermann
              Reporter:
              cajus Cajus Pollmeier
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: