C++ (Qt)int main(int argc, char* argv[]){ MyClass mc; qDebug() << "Default mode: " << mc.mode(); mc.setMode(MyClass::Option4); qDebug() << "New mode: " << mc.mode(); mc.setMode(MyClass::Option1 | MyClass::Option3 | MyClass::Option5); qDebug() << "Combined flags: " << mc.mode(); return 0;}
Default mode: "NoOptions" 0New mode: "Option4" 8Combined flags: "Option1|Option3|Option5" 21