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. Q_DECLARE_INCOMPATIBLE_FLAG - this seems like a useful macro, but I can't find any documentation on it.
Forum Update on Monday, May 27th 2025

Q_DECLARE_INCOMPATIBLE_FLAG - this seems like a useful macro, but I can't find any documentation on it.

Scheduled Pinned Locked Moved General and Desktop
qobjectqproperty
1 Posts 1 Posters 784 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
    shavera
    wrote on 25 Jun 2015, 15:13 last edited by shavera
    #1

    Edit: It doesn't seem like this macro did what I hoped it would, under more inspection. Maybe there's a better way to set mutually exclusive options? </end edit>

    Supposing I have flags that are mutually exclusive (say something can either be A or B, which I'd like to be named flags), this seems useful.

    At the moment I'm doing something I think is a bit hacky

    Enum Flag{
      A = 1,
      B = ~1
    };
    Q_DECLARE_FLAGS(Flags, Flag)
    

    But the Incompatible flag option seems more like the right approach (given what I can kind of figure from the source code around the macro)

    1 Reply Last reply
    0

    1/1

    25 Jun 2015, 15:13

    • Login

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