Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21815

"File or directory not found" in QML import statement

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 4.8.0
    • Quick / QML Support
    • None
    • macOS

    Description

      I have a QML file (Video.qml) located in a resource file (Video.qrc) from a Video.pri file included by my main project.

      Since the Video.qml has a "Video" prefix, I need to add the import "Video" statement in my main.qml file as shown below:

      Unable to find source-code formatter for language: qml. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      import QtQuick 2.9
      import QtQuick.Window 2.2
      
      import "Video"
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("My app")
      
          Video {
              id: video
              anchors.fill: parent
          }
      }
      

      It works as expected but the clazy analyzer detect a false error at the import "Video" line:

      File or directory not found
      

      Note that the Video element is not highlighted properly.

      Attachments

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

        Activity

          People

            tjenssen Tim Jenssen
            martindelille Martin Delille
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes