On Wednesday, 18 January 2017 21:12:07 CET Stephen Kelly wrote: > Hello, > > As a result of the recent porting from 0 to nullptr, we have things like > > Qt::WindowFlags f = nullptr > > in frameworks headers. See for example kruler. That is - enum default > parameter values have been ported incorrectly. > > I don't know if some clang tooling is being used to do the porting, but if > so, the tool is buggy.
clang-tidy was used. I don't see why the tool is buggy. Example change from kruler.h: - explicit KRuler(Qt::Orientation orient, QWidget *parent = 0, Qt::WindowFlags f = 0); + explicit KRuler(Qt::Orientation orient, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr); Both: Qt::WindowFlags f = 0, and Qt::WindowFlags f = nullptr call this QFlags [1] ctor: QFlags(Zero) => The porting was correct If it looks odd, that might be indeed another issue. But from a technical this is correct. As I said on the Diff already, just port it to this if you want to: Qt::WindowFlags = {} Note: I'll be in vacation starting today, for 3 weeks, won't have time to implement this. Regards, Kevin [1] QFlags ctors: Q_DECL_CONSTEXPR inline QFlags(Enum f) Q_DECL_NOTHROW : i(Int(f)) {} Q_DECL_CONSTEXPR inline QFlags(Zero = Q_NULLPTR) Q_DECL_NOTHROW : i(0) {} Q_DECL_CONSTEXPR inline QFlags(QFlag f) Q_DECL_NOTHROW : i(f) {} #ifdef Q_COMPILER_INITIALIZER_LISTS Q_DECL_CONSTEXPR inline QFlags(std::initializer_list<Enum> flags) Q_DECL_NOTHROW : i(initializer_list_helper(flags.begin(), flags.end())) {} #endif > Attempting to build the python bindings now fails because our scripting to > generate sip files (or sip itself - I didn't investigate further because it > seems obvious that the headers should be fixed to solve the issue) can not > handle this. > > Thanks, > > Steve. -- Kevin Funk | kf...@kde.org | http://kfunk.org
signature.asc
Description: This is a digitally signed message part.