Go to file
Olivier Goffart e759d38d49 Declare the operator| in the Qt namespace for QFlags in that namespaces
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-sudden
https://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>
2018-04-08 14:24:27 +00:00
bin syncqt: remove 'descend' parameter from findFiles() 2018-02-28 18:15:56 +00:00
config.tests Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
dist Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
doc Doc: Increment copyright year in global doc templates 2018-04-04 06:56:00 +00:00
examples Merge remote-tracking branch 'origin/5.11' into dev 2018-03-31 01:00:13 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
mkspecs qmake: add support for mkspecs which don't support strict_c++ 2018-04-05 18:55:46 +00:00
qmake Set WindowsTargetPlatform[Min]Version if WindowsSDKVersion is set 2018-04-06 06:18:00 +00:00
src Declare the operator| in the Qt namespace for QFlags in that namespaces 2018-04-08 14:24:27 +00:00
tests Declare the operator| in the Qt namespace for QFlags in that namespaces 2018-04-08 14:24:27 +00:00
util Add a note to the CLDR-munging scripts about updating the attribution 2018-02-17 22:22:33 +00:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore gitignore: don't ignore Info.plist templates for libraries 2017-11-23 07:07:48 +00:00
.qmake.conf Bump version 2018-02-20 19:53:08 +01:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
config_help.txt xcb: Use XCB instead of Xlib for XInput 2018-03-22 20:51:09 +00:00
configure configure: Detect Cocoa instead of Carbon 2018-04-05 21:04:22 +00:00
configure.bat configure: Prefer cl.exe over clang-cl.exe 2018-01-04 21:22:42 +00:00
configure.json Merge remote-tracking branch 'origin/5.11' into dev 2018-03-28 08:12:21 +02:00
configure.pri configure: introduce 'subarch' term to expression evaluator 2018-02-22 21:39:36 +00:00
header.BSD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.COMM Add header template for commercial only modules 2015-10-19 10:37:18 +00:00
header.FDL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL3 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3-COMM Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL-NOGPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL-ONLY Update copyright headers 2015-02-11 06:49:51 +00:00
INSTALL Doc: Update links in INSTALL file 2015-02-16 09:06:41 +00:00
LGPL_EXCEPTION.txt Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPLv21 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.PREVIEW.COMMERCIAL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
qtbase.pro nuke configure -host-option 2016-12-13 18:55:59 +00:00
sync.profile Testlib: Rename qtest_global.h to qttestglobal.h 2018-03-21 10:31:01 +00:00