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

Generated qmltyperegistrations file has wrong include

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 1.16.0
    • Fix Version/s: None
    • Component/s: Libraries: Qt
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      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?

        Attachments

          Issue Links

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes