Results 1 to 3 of 3

Thread: OR combination flags in QAbstractFileEngine

  1. #1
    Join Date
    Jan 2007
    Location
    Hamburg, Germany
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Talking OR combination flags in QAbstractFileEngine

    Hi all,

    I need one fileFlag from an OR combination of FileFlags values (from QAbstractFileEngine).

    This don't work:
    Qt Code:
    1. QAbstractFileEngine *engine = QAbstractFileEngine::create("/home/chris/blah");
    2. if ( engine->fileFlags() == QAbstractFileEngine::FileType )
    To copy to clipboard, switch view to plain text mode 

    How can I check, if QAbstractFileEngine::FileType (for example) is in the compination of QAbstractFileEngine::fileFlags()?

    Thx!
    Chris

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: OR combination flags in QAbstractFileEngine

    Qt Code:
    1. if( engine->fileFlags().testFlag( QAbstractFileEngine::FileType ) ) {
    2. // ...
    3. }
    4. // or more traditionally:
    5. if( engine->fileFlags() & QAbstractFileEngine::FileType ) {
    6. // ...
    7. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2007
    Location
    Hamburg, Germany
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: OR combination flags in QAbstractFileEngine

    Ah, that was it! Thanks!

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.