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

Qt Creator cannot find QML modules when directory names are the same

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • Qt Creator 4.7.0, Qt Creator 4.9.1
    • Quick / QML Support
    • None
    • All

    Description

      In our project we are using 3rd-party QML module, that has some components and styles defined in the following directory structure:

      modules/Material/
      modules/QtQuick/Controls/Styles/Material/

      In the qmake project file we import it using:

      QML_IMPORT_PATH += ../3rdparty/qml-material/modules

      With this import enabled Qt Creator (editor in fact) shows an error like these:

      Could not resolve the prototype "Controls.TextField" of "TextField"
      Could not resolve the prototype "Controls.Button" of "Button"

      TextField and Button are components defined in:

      import Material 0.2

      Inside, these components have import:

      import QtQuick.Controls 1.3 as Controls

      Which is marked in red with an error:

      QML module not found (QtQuick.Controls)

      Import paths:
      /.../Qt/.../qml
      /.../project/.../3rdparty/qml-material/modules

      For qmake ...
      For Qbs ...
      For qmlproject ...
      For Cmake ...

      When I change directory name from 3rdparty/qml-material/modules/QtQuick to something else Qt Creator parses everything correctly but, of course, styling doesn't work.

      Our application compiles and runs flawlessly, the problem is only in the editor.

      My guess is that Qt Creator can't load/parse multiple QML files when directories are named the same.

      Attachments

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

        Activity

          People

            fawzi Fawzi Mohamed
            kmaterka Konrad Materka
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes