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

How to use qmllint on multiple components in one project?

    XMLWordPrintable

Details

    • All

    Description

      I'm a big fan of qmllint, thanks for this very helpful tool!

      However there is a problem: As our number of QML components grows, we sometimes have projects that include more than one QML component. As long as there is only a single component, I can successfully use qmllint via the ninja build file target ninja all_qmllint, and it resolves dependent QML components installed in TARGETDIR. But when a project includes multiple QML components, then at then time when ninja all_qmllint executes, none of the components is already installed in TARGETDIR, and qmllint fails to resolve them.

      In this case, qmllint shows errors about unknown imports for all components that live in the same project.

      To better illustrate the problem, here is an example folder layout:

      MyProject
        -> CMakeLists.txt
        -> MyQuick/
          -> Models/
            -> src/
            -> CMakeLists.txt
          -> Components/
            -> src/
            -> CMakeLists.txt
      

      The component "MyQuick.Components" depends on "MyQuick.Models". But qmllint does not resolve this at the time when ninja all_qmllint executes (which is before the actual build and install steps).

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            emmenlau Mario Emmenlauer
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes