Skip to content

Commit ab868c7

Browse files
committed
Replace Q_NULLPTR by nullptr
The former is a compatibility macro for code not allowed to use C++11.
1 parent 76f1aac commit ab868c7

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

cfg/qt.cfg

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@
417417
<not-bool/>
418418
</arg>
419419
</function>
420-
<!-- bool QObject::disconnect(const char *signal = Q_NULLPTR, const QObject *receiver = Q_NULLPTR, const char *method = Q_NULLPTR) const -->
421-
<!-- bool QObject::disconnect(const QObject *receiver, const char *method = Q_NULLPTR) const -->
420+
<!-- bool QObject::disconnect(const char *signal = nullptr, const QObject *receiver = nullptr, const char *method = nullptr) const -->
421+
<!-- bool QObject::disconnect(const QObject *receiver, const char *method = nullptr) const -->
422422
<!-- bool QObject::disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method) // static -->
423423
<!-- bool QObject::disconnect(const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) // static -->
424424
<!-- bool QObject::disconnect(const QMetaObject::Connection &connection) // static -->
@@ -467,7 +467,7 @@
467467
<not-uninit/>
468468
</arg>
469469
</function>
470-
<!-- QString QObject::tr(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) //static -->
470+
<!-- QString QObject::tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) //static -->
471471
<function name="tr,QObject::tr">
472472
<noreturn>false</noreturn>
473473
<returnValue type="QString"/>
@@ -2041,7 +2041,7 @@
20412041
<use-retval/>
20422042
<const/>
20432043
</function>
2044-
<!-- int QString::toInt(bool *ok = Q_NULLPTR, int base = 10) const -->
2044+
<!-- int QString::toInt(bool *ok = nullptr, int base = 10) const -->
20452045
<function name="QString::toInt">
20462046
<noreturn>false</noreturn>
20472047
<returnValue type="int"/>
@@ -2459,9 +2459,9 @@
24592459
<not-uninit/>
24602460
</arg>
24612461
</function>
2462-
<!-- QString QFileDialog::getOpenFileName(QWidget *parent = Q_NULLPTR, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = Q_NULLPTR, Options options = Options()) //static -->
2463-
<!-- QString QFileDialog::getSaveFileName(QWidget *parent = Q_NULLPTR, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = Q_NULLPTR, Options options = Options()) //static -->
2464-
<!-- QString QFileDialog::getExistingDirectory(QWidget *parent = Q_NULLPTR, const QString &caption = QString(), const QString &dir = QString(), Options options = ShowDirsOnly) //static -->
2462+
<!-- QString QFileDialog::getOpenFileName(QWidget *parent = nullptr, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = nullptr, Options options = Options()) //static -->
2463+
<!-- QString QFileDialog::getSaveFileName(QWidget *parent = nullptr, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = nullptr, Options options = Options()) //static -->
2464+
<!-- QString QFileDialog::getExistingDirectory(QWidget *parent = nullptr, const QString &caption = QString(), const QString &dir = QString(), Options options = ShowDirsOnly) //static -->
24652465
<function name="QFileDialog::getOpenFileName,QFileDialog::getSaveFileName,QFileDialog::getExistingDirectory">
24662466
<noreturn>false</noreturn>
24672467
<returnValue type="QString"/>
@@ -2470,7 +2470,7 @@
24702470
<not-uninit/>
24712471
</arg>
24722472
</function>
2473-
<!-- QStringList QFileDialog::getOpenFileNames(QWidget *parent = Q_NULLPTR, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = Q_NULLPTR, Options options = Options()) //static -->
2473+
<!-- QStringList QFileDialog::getOpenFileNames(QWidget *parent = nullptr, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = nullptr, Options options = Options()) //static -->
24742474
<function name="QFileDialog::getOpenFileNames">
24752475
<noreturn>false</noreturn>
24762476
<returnValue type="QStringList"/>
@@ -5325,7 +5325,7 @@
53255325
<define name="Q_NAMESPACE_EXPORT" value=""/>
53265326
<define name="Q_DECL_EXPORT" value=""/>
53275327
<define name="Q_DECL_IMPORT" value=""/>
5328-
<define name="QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)" value="static inline QString trUtf8(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) { return QCoreApplication::translate(#context, sourceText, disambiguation, n); }"/>
5328+
<define name="QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)" value="static inline QString trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate(#context, sourceText, disambiguation, n); }"/>
53295329
<define name="Q_DECLARE_FLAGS(x,y)" value=""/>
53305330
<define name="Q_DECLARE_SEQUENTIAL_ITERATOR(C)" value=""/>
53315331
<define name="Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(C)" value=""/>
@@ -5339,7 +5339,7 @@
53395339
<define name="Q_DECLARE_PRIVATE(Class)" value="inline Class##Private* d_func() { return reinterpret_cast&lt;Class##Private*&gt;(qGetPtrHelper(d_ptr)); } inline const Class##Private d_func() const { return reinterpret_cast&lt;const Class##Private *&gt;(qGetPtrHelper(d_ptr)); } friend class Class##Private;"/>
53405340
<define name="Q_DECLARE_PRIVATE_D(Dptr, Class)" value="inline Class##Private* d_func() { return reinterpret_cast&lt;Class##Private *&gt;(qGetPtrHelper(Dptr)); } inline const Class##Private* d_func() const { return reinterpret_cast&lt;const Class##Private *&gt;(qGetPtrHelper(Dptr)); } friend class Class##Private;"/>
53415341
<define name="Q_DECLARE_PUBLIC(Class)" value="inline Class##Public* d_func() { return reinterpret_cast&lt;Class##Public*&gt;(qGetPtrHelper(d_ptr)); } inline const Class##Public d_func() const { return reinterpret_cast&lt;const Class##Public *&gt;(qGetPtrHelper(d_ptr)); } friend class Class##Public;"/>
5342-
<define name="Q_DECLARE_TR_FUNCTIONS(context)" value="public: static inline QString tr(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) { return QCoreApplication::translate(#context, sourceText, disambiguation, n); } QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) private:"/>
5342+
<define name="Q_DECLARE_TR_FUNCTIONS(context)" value="public: static inline QString tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate(#context, sourceText, disambiguation, n); } QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) private:"/>
53435343
<define name="Q_DISABLE_COPY(C)" value="C(C&amp;);C&amp; operator=(const C&amp;);"/>
53445344
<define name="Q_EMIT" value=""/>
53455345
<define name="Q_ENUM(X)" value=""/>
@@ -5352,7 +5352,7 @@
53525352
<define name="Q_INTERFACES(X)" value=""/>
53535353
<define name="Q_LIKELY(expr)" value="expr"/>
53545354
<define name="Q_NAMESPACE" value=""/>
5355-
<define name="Q_NULLPTR" value="NULL"/>
5355+
<define name="nullptr" value="NULL"/>
53565356
<define name="Q_OBJECT" value="static void qt_static_metacall(QObject*,QMetaObject::Call,int,void**);const MetaObject* metaObject() const;void* qt_metacast(const char*);int qt_metacall(QMetaObject::Call,int,void**);"/>
53575357
<define name="Q_PRIVATE_SLOT(d, signature)" value=""/>
53585358
<define name="Q_SLOTS" value=""/>

test/cfg/qt.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ void validCode(int * pIntPtr, QString & qstrArg, double d)
583583
Q_UNUSED(d)
584584
if (QFile::exists("test")) {}
585585

586-
if (pIntPtr != Q_NULLPTR) {
586+
if (pIntPtr != nullptr) {
587587
*pIntPtr = 5;
588588
}
589589

@@ -627,11 +627,11 @@ void ignoredReturnValue()
627627

628628
void nullPointer(int * pIntPtr)
629629
{
630-
int * pNullPtr = Q_NULLPTR;
630+
int * pNullPtr = nullptr;
631631
// cppcheck-suppress nullPointer
632632
*pNullPtr = 1;
633633

634-
if (pIntPtr != Q_NULLPTR) {
634+
if (pIntPtr != nullptr) {
635635
*pIntPtr = 2;
636636
} else {
637637
// cppcheck-suppress nullPointerRedundantCheck

0 commit comments

Comments
 (0)