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

QML Designer doesn't resolve import path correctly

    XMLWordPrintable

Details

    Description

      QML Designer seems to have problems importing QML modules from a project to another project, even if the QML_IMPORT_PATH is setup.

      I attached an example of project. I have a SUBDIRS with two .pro, a library and a app.
      The projects compile and works (in main.cpp the correct folder is added to the import path), but when I try to open MainForm.ui.qml with QML Designer, a lot of problems arise.

      The line...

      import Library 1.0
      

      is underlined in red and QML Designer explodes. The error message is puzzling because it clearly said that the correct path is in QML import path, but the module is still not found.

      If I substitute the line with:

      import "../Library" 1.0
      

      everything seems fine but... the components of the library ARE NOT displayed in the QML Types tab, and so are not available in the Designer to be drag&dropped.

      If I move the QML_IMPORT_PATH settings from the app.pro to the main .pro, something strange happens.
      QtCreator 3.6 starts to open the MainForm.ui.qml properly (but components are still missing from the drag&drop tab), but QtCreator 4.0.0 still fails.

      I think the expected behavior is:

      import Library 1.0
      

      this should work in any case, if the QML_IMPORT_PATH is properly setup and that all the components available should be correctly displayed in the QML Types tab inside QML Designer.

      Attachments

        1. default_puppet.jpg
          16 kB
          Tim Jenssen
        2. puppet_built_by_selected_qt.jpg
          145 kB
          Tim Jenssen
        3. qmldesigner.zip
          5 kB
          Daniele Maccioni

        Activity

          People

            thohartm Thomas Hartmann
            gendoikari Daniele Maccioni
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: