qtkeychain icon indicating copy to clipboard operation
qtkeychain copied to clipboard

Use better Q_NULLPTR.

Open tuxmaster5000 opened this issue 5 years ago • 4 comments

This will be the official Qt way.

tuxmaster5000 avatar Oct 13 '18 08:10 tuxmaster5000

It there is an official Qt way, it would be to use nullptr now. (But I think currently, qtkeychain still does not require C++11. But I think it would make sense to require it)

ogoffart avatar Oct 13 '18 11:10 ogoffart

Q_NULLPTR is not compatible with Qt4. Don't know if it's of any importance nowadays but right now latest QtKeychain appears to be buildable with Qt4. It would no longer be if this PR is accepted, at least in its current state. Even if it's ok to drop the support for Qt4 now, it should be done properly: for one thing, the option to build with Qt4 should be removed from CMakeLists.txt.

d1vanov avatar Oct 13 '18 12:10 d1vanov

Qt4 it out of support since 2015 from vendor. So I think the support of it here can also be dropped. Using nullptr has the problem that not all compiler support it. So the Q_NULLPTR will use nullptr for compiler that support it and null(not 0) for the rest. See the details for it in the file qcompilerdetection.h of the source code of Qt.

tuxmaster5000 avatar Oct 13 '18 12:10 tuxmaster5000

As long as there's no strong reason to drop Qt 4 support, I will keep it. One could create a local version of the macro that also works for Qt 4, but that's probably not worth the effort.

frankosterfeld avatar Oct 15 '18 08:10 frankosterfeld