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

Declared alias import not found

    XMLWordPrintable

Details

    • All
    • 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

          For Gerrit Dashboard: QTBUG-102147
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: