Results 1 to 2 of 2

Thread: Bit operations

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Bit operations

    Hi,

    my logic reaches the end. I have a bit mask defined and want following behavior when comparing FlagI and FlagII:
    Qt Code:
    1. enum Flag
    2. {
    3. A = 0x00000001,
    4. B = 0x00000002,
    5. C = 0x00000004,
    6. D = 0x00000008
    7. };
    8. Q_DECLARE_FLAGS(Flags, Flag)
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. //
    2. A B C D
    3. ------------------
    4. FlagI 1 0 0 1
    5. FlagII 0 1 0 1
    6. ------------------
    7. Result 0 1 0 0
    To copy to clipboard, switch view to plain text mode 
    But I can't figure it out since I am unable to distinguish between (FlagI-A:0 FlagII-A:1) and (FlagI-A:1 FlagII-A:0). Is that possible?


    Thanks

    Lykurg

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Bit operations

    NOT AGAIN! 5 minutes after posting I found the answer: ~FlagI & FlagII. (And that stupid thing coast me 40 minutes! Time for a break, I'm having a lunch now.)

Similar Threads

  1. Threaded List-operations
    By soul_rebel in forum Qt Programming
    Replies: 3
    Last Post: 19th March 2010, 12:24
  2. Article about asynchronous operations
    By skrzypu in forum Qt Programming
    Replies: 0
    Last Post: 10th March 2010, 11:43
  3. String operations, printing to stdout
    By Cruz in forum Newbie
    Replies: 3
    Last Post: 20th January 2009, 15:30
  4. How to manage QSqlTableModel database operations?
    By Abk in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2007, 10:44
  5. Graphics operations - Qt 4.1
    By hoborg in forum Newbie
    Replies: 1
    Last Post: 18th February 2006, 14:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.