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

Named import not recognized

    XMLWordPrintable

Details

    • 5860c9c12 (dev), 9c62538e5 (6.5)

    Description

      I found a left over of Qt5 style code that we don't use anymore this way:

      import QtQuick
      import 'qrc:/untitled/components' as C
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
          title: "Foo"
      
          C.Foo {}
      }
      

      The compiler claims

      Warning: main.qml:11:5: C.Foo was not found. Did you add all import paths?
          C.Foo {}
          ^
      Info: Did you mean "Foo"?
          Foo.Foo {}
          ^^^
      Warning: main.qml:11:5: Type C.Foo is used but it is not resolved
          C.Foo {}
          ^
      Info: main.qml:2:1: Unused import at main.qml:2:1
      import 'qrc:/untitled/components' as C
      ^^^^^^

      , but works during runtime. This is a bit special for sure...

      Example attached.

      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
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes