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. Header.h in qml files
Forum Updated to NodeBB v4.3 + New Features

Header.h in qml files

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.9k 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.
  • S Offline
    S Offline
    Schneidi
    wrote on last edited by
    #1

    Hey guys,

    I was wondering if it is possible and meaningful to include C++ header in qml.
    I'm speaking about Header files with #define declarations.

    So I can access definition from C++ and Qml.

    Thanks for help.

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

      No, it doesn't work like that. There is a whole section in the documentation about interfacing C++ and QML code (in both directions) in the Qt documentation though.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #3

        Usually the Qt Quick files are not run through the C preprocessor, so its statements like #ifdef, #include, etc. are not evaluated.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Schneidi
          wrote on last edited by
          #4

          ok thanks.

          I used another approach to realize this.

          1 Reply Last reply
          0

          • Login

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