[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-frameworks-devel
Subject: Re: Qt::WindowFlags f = nullptr in framworks headers
From: Kevin Funk <kfunk () kde ! org>
Date: 2017-01-20 8:19:21
Message-ID: 59421496.tO4ayF10xb () kerberos
[Download RAW message or body]
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 | kfunk@kde.org | http://kfunk.org
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic