Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.3.0 Beta1
-
None
-
OSX 10.9, Qt5.3.1, latest PyQt
Description
Compiling PyQt on OSX yields compile error:
/Users/bootch/Downloads/PyQt-gpl-5.2.1/sip/QtCore/qglobal.sip:132:48: error: conversion from 'long' to 'QFlag'
is ambiguous
*sipCppPtr = new QByteArray::Base64Options(SIPLong_AsLong(sipPy));
/Users/bootch/qt5/qtbase/lib/QtCore.framework/Headers/qflags.h:60:29: note: candidate constructor
Q_DECL_CONSTEXPR inline QFlag(int ai) : i(ai) {}
I think the compiler is looking for a QFlag constructor that takes a long arg.
qflags.h has this:
#if !defined(_LP64_) && !defined(Q_QDOC)
Q_DECL_CONSTEXPR inline QFlag(long ai) : i(int(ai)) {}
Q_DECL_CONSTEXPR inline QFlag(ulong ai) : i(int(long(ai))) {}
#endif
Removing the first bang fixes the problem. I could be wrong, but it seems like the logic of the #if is reversed: it is on a 64-bit platform where the definition is needed, to convert from a 64-bit long argument to a 32-bit QFlag instance.