[Merge] lp:~mir-team/qtubuntu/port-to-mirclient into lp:qtubuntu

Albert Astals Cid albert.astals at canonical.com
Thu Feb 12 08:36:17 UTC 2015


Review: Needs Fixing

> >> why not make q_modifiers a Qt::KeyboardModifiers instead of an int so you
> can save the last
> >> static_cast?
> >> why not make q_modifiers a Qt::MouseButton instead of an int so you can
> save the last
> >> static_cast?
> 
> Because operator| casts the Qt::KeyboardModifier to an int and then attempting
> to assign back to a Qt::Modifier results in an illegal conversion between int
> and enum types. Enums can not be used as flags in C++ without a cast or
> operator overloading.

No, Qt::KeyboardModifiers is not an enum, it's a QFlags of type Qt::KeyboardModifier, QFlags that has defined the |= operator so no conversion between int and enum types is happening.
-- 
https://code.launchpad.net/~mir-team/qtubuntu/port-to-mirclient/+merge/245164
Your team Ubuntu Phablet Team is subscribed to branch lp:qtubuntu.



More information about the Ubuntu-reviews mailing list