Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1591

Generated qmltyperegistrations file has wrong include

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 1.16.0
    • Libraries: Qt
    • None
    • Windows

      So I have a qbs project where files are located in subfolders.

      import qbs
      
      CppApplication {
          name: "test"
      
          cpp.cxxLanguageVersion: "c++17"
      
          Depends { name: "Qt"; submodules: ["core", "qml"] }
      
          Qt.qml.importName: "test"
          Qt.qml.importVersion: "1.0"
      
          files: [
              "main.cpp",
              "test/test.h"
          ]
      }
      
      #pragma once
      
      #include <QObject>
      #include <qqml.h>
      
      class Test : public QObject
      {
          Q_OBJECT
          QML_ELEMENT
      };
      

      If I try to use new QML type registration, qmlregistar generates file, where test.h gets included via include path.

      #include <QtQml/qqml.h>
      #include <QtQml/qqmlmoduleregistration.h>
      
      #include <test.h>
      
      void qml_register_types_test()
      {
          qmlRegisterTypesAndRevisions<Test>("test", 1);
          qmlRegisterModule("test", 1, 0);
      }
      
      static const QQmlModuleRegistration registration("test", 1, qml_register_types_test);
      

      So I get obvious error: fatal error C1083: Cannot open include file: 'test.h': No such file or directory

      May be I don't understand something or is it a qbs/qmlregistrar problem?

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

            kandeler Christian Kandeler
            mabean Max Bespalov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes