Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem with QML_ELEMENT for classes in subfolder of project
Forum Update on Tuesday, May 27th 2025

Problem with QML_ELEMENT for classes in subfolder of project

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 271 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • shavS Offline
    shavS Offline
    shav
    wrote on last edited by
    #1

    Hello everyone!

    I'm trying to refactoring my old QML Plugins to the new concept which using QML_ELEMENT macro for qml types and I have a problem with it. If my class which I marked as QML_ELEMENT saved in root folder of project all works fine but if I save class to sub folder then I received error like this one:

    "shikimorisdk_debug_qmltyperegistrations.cpp:10:10: fatal error: 'shikimoriuianimelistview.h' file not found
    #include <shikimoriuianimelistview.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~"
    

    I can't undersend how I can fix this or maybe all classes which need to using as qml types must be saves into project root folder?

    Thanks for the any help!

    Mac OS and iOS Developer

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Anumas
      wrote on last edited by
      #2

      Try adding your subfolder to the include path, for example: using CMake target_include_directories(myLib PRIVATE subfolder).

      Say hello to a bright day.-

      Anumas.

      shavS 1 Reply Last reply
      2
      • A Anumas

        Try adding your subfolder to the include path, for example: using CMake target_include_directories(myLib PRIVATE subfolder).

        shavS Offline
        shavS Offline
        shav
        wrote on last edited by
        #3

        @Anumas Thanks for the answer! Added subfolder to INCLUDEPATH is help to me.

        Mac OS and iOS Developer

        1 Reply Last reply
        0
        • shavS shav has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved