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

addImportPath not used for parsing qml files.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • Qt Creator 3.0.0-rc1
    • Quick / QML Support
    • None
    • linux 32bit [android package]

    Description

      steps:
      1- create a qml project using QQmlApplicationEngine.
      2- create simple qml plugin. dir tree:
      -qmlcomponentMyComponent-[qmldir,CustomControl.qml]
      3- add import path in main.cpp
      qmlappengine.addImportPath("qmlcomponent/")
      4- use this component in main.qml
      import MyComponent 1.0 as MC
      MC.CustomControl{}
      it works when running application but qtcreator can't recognize import path and autocomplete not working there. also red underline in import statement with this hint: qml module not found ....

      when searched on the web it says that you can set QML2_IMPORT_PATH environment variable for fixing this issue. but setting this variable on
      qmake .pro file can't solve the problem and also setting this in build environment.
      and it must be set in operating system's environment variables.
      and it is not good idea for changing operating system's variables for project's local components.

      Attachments

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

        Activity

          People

            fawzi Fawzi Mohamed
            chezgi abbas ali chezgi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes