Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. forward use of Q_ENUM

forward use of Q_ENUM

Scheduled Pinned Locked Moved Solved General and Desktop
qenum
3 Posts 2 Posters 222 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.
  • A Offline
    A Offline
    Alain38 0
    wrote on last edited by
    #1

    Hi,
    I have an header file that contain various enum declarations (in a namespace). This file is shared between two applications. One is using Qt (the one I work on). The second application does not use Qt (specific hardware).

    Now, in the application using Qt, I would define the enums with Q_ENUM/Q_ENUM_NS macros. How can I do?

    Thanks for your help.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You would need some ifdefs to disable the Qt part when using that header outside of the application context. Or rather the other way around, enable it when using Qt.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      1
      • A Alain38 0 has marked this topic as solved on
      • SGaistS SGaist

        Hi,

        You would need some ifdefs to disable the Qt part when using that header outside of the application context. Or rather the other way around, enable it when using Qt.

        A Offline
        A Offline
        Alain38 0
        wrote on last edited by
        #3

        @SGaist Thanks. Sometimes we do not think about the simplest solutions.

        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