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

Documentation bug: import from absolute path requires file://... network syntax

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.15.7, 6.2.1
    • Documentation
    • None
    • Linux/X11

      https://doc.qt.io/qt-6/qtqml-syntax-directoryimports.html say QML modules

      "can import a local directory as using an import statement that refers to the directory's absolute or relative file system path" and goes on to say a 'qmldir' is unnecessary.

      But absolute paths do not work.   The only way to specify an absolute local path is using the "network" URL syntax "file://absolute/path".

      For example,

          import "/home/jima/Mymodules"

      results in:  import "/home/jima/Mymodules" has no qmldir and no namespace
      qml: Did not load any objects, exiting.

      Suggest: Change the docs to say that absolute paths can only be referenced with a URL of the form file://... .   Or, change the code to work as currently documented, that is, make it accept absolute path names.

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

            docteam Qt Documentation Team
            jimav Jim Avera
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes