This is a long overdue change so we don't break ADL of operator|.
I think will not break source or binary compatibility.
The problem is code like this:
namespace Foo {
struct MyStruct;
MyStruct operator|(MyStruct, MyStruct);
void someFunction() {
fooLabel->setAlignement(Qt::AlignLeft | Qt::AlignTop)
}
}
This would be an error before as ADL would find only the Foo::operator| and not
the global one since the arguments are not in the global namespace.
After this change, ADL works fine and this code compiles
This bites people with misterious error, see questions on
https://stackoverflow.com/questions/10755058/qflags-enum-type-conversion-fails-all-of-a-suddenhttps://stackoverflow.com/questions/39919142/broken-bitwise-or-operator-in-a-qt-project
[ChangeLog][QtCore] QFlags's operator| for enum types in the Qt namespace are
now declared in the Qt namespace itself.
Change-Id: I021bce11ec1521b4d8795a2cf3084a0be1960804
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>