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. Preprocessor macro and Q_INVOKABLE
Forum Updated to NodeBB v4.3 + New Features

Preprocessor macro and Q_INVOKABLE

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.6k 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.
  • M Offline
    M Offline
    michael
    wrote on last edited by
    #1

    I need to declare Q_INVOKABLE method inside a preprocessor macro.
    Is it possible? Looks like it does not work.

    Thank you,
    Michael

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

      No, that is not possible. Q_INVOKABLE is processed by moc, which does not expand macros itself and is run before macros are expanded.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        The same is true for many other Q_* "macros". They actually expand to nothing in the preprocessor. They are special keywords used by the meta-object compiler to indicate that it needs to generate some code there.

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        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