Use Q_DECLARE_OPERATORS_FOR_FLAGS in same namespace as flags definition
Having the macro's definition of the operator| in the namespace of the flags argument improves/unbreaks things for the argument-dependent lookup of unqualified function names, e.g. when flags are combined in calls of other methods, but there is some other operator| defined in the namespace of the current code. Given Q_DECLARE_OPERATORS_FOR_FLAGS creates inlined functions, this should be a source and binary compatible change. Qt did similar for Qt 5.12 in https://codereview.qt-project.org/c/qt/qtbase/+/225348
This commit is contained in:
parent
3509283d63
commit
3f8469acb1
@ -305,8 +305,8 @@ private:
|
||||
//Q_PRIVATE_SLOT(d, void updateSizes())
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(FrameSvg::EnabledBorders)
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::FrameSvg::EnabledBorders)
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
@ -297,10 +297,11 @@ PLASMA_EXPORT Types::Direction locationToDirection(Types::Location location);
|
||||
**/
|
||||
PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location location);
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Types::Constraints)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Types::Flip)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Types::ComponentTypes)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Types::BackgroundFlags)
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Constraints)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Flip)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::ComponentTypes)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::BackgroundFlags)
|
||||
#endif // multiple inclusion guard
|
||||
|
Loading…
x
Reference in New Issue
Block a user