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 Monday, 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 264 Views
  • 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.
  • S Offline
    S Offline
    shav
    wrote on 24 Aug 2024, 19:03 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 24 Aug 2024, 19:10 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.

      S 1 Reply Last reply 24 Aug 2024, 19:25
      2
      • A Anumas
        24 Aug 2024, 19:10

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

        S Offline
        S Offline
        shav
        wrote on 24 Aug 2024, 19:25 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
        • S shav has marked this topic as solved on 24 Aug 2024, 19:25

        1/3

        24 Aug 2024, 19:03

        • Login

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