QtCore: Use Q_NULLPTR instead of 0 in all public headers

This is in preparation of adding -Wzero-as-null-pointer-constant (or similar)
to the headers check.

Task-number: QTBUG-45291
Change-Id: I0cc388ef9faf45cbcf425ad0dc77db3060c104a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2015-06-30 22:11:15 +02:00
parent 1be6bad232
commit 6251d4dafc
72 changed files with 291 additions and 290 deletions

View File

@ -76,7 +76,7 @@ public:
DeleteWhenStopped
};
QAbstractAnimation(QObject *parent = 0);
QAbstractAnimation(QObject *parent = Q_NULLPTR);
virtual ~QAbstractAnimation();
State state() const;
@ -111,7 +111,7 @@ public Q_SLOTS:
void setCurrentTime(int msecs);
protected:
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0);
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
bool event(QEvent *event) Q_DECL_OVERRIDE;
virtual void updateCurrentTime(int currentTime) = 0;
@ -130,7 +130,7 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject
Q_DECLARE_PRIVATE(QAnimationDriver)
public:
QAnimationDriver(QObject *parent = 0);
QAnimationDriver(QObject *parent = Q_NULLPTR);
~QAnimationDriver();
virtual void advance();
@ -156,7 +156,7 @@ protected:
virtual void start();
virtual void stop();
QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = 0);
QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = Q_NULLPTR);
private:
friend class QUnifiedTimer;

View File

@ -47,7 +47,7 @@ class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation
Q_OBJECT
public:
QAnimationGroup(QObject *parent = 0);
QAnimationGroup(QObject *parent = Q_NULLPTR);
~QAnimationGroup();
QAbstractAnimation *animationAt(int index) const;

View File

@ -47,7 +47,7 @@ class Q_CORE_EXPORT QParallelAnimationGroup : public QAnimationGroup
Q_OBJECT
public:
QParallelAnimationGroup(QObject *parent = 0);
QParallelAnimationGroup(QObject *parent = Q_NULLPTR);
~QParallelAnimationGroup();
int duration() const Q_DECL_OVERRIDE;

View File

@ -48,8 +48,8 @@ class Q_CORE_EXPORT QPauseAnimation : public QAbstractAnimation
Q_OBJECT
Q_PROPERTY(int duration READ duration WRITE setDuration)
public:
QPauseAnimation(QObject *parent = 0);
QPauseAnimation(int msecs, QObject *parent = 0);
QPauseAnimation(QObject *parent = Q_NULLPTR);
QPauseAnimation(int msecs, QObject *parent = Q_NULLPTR);
~QPauseAnimation();
int duration() const Q_DECL_OVERRIDE;

View File

@ -49,8 +49,8 @@ class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject)
public:
QPropertyAnimation(QObject *parent = 0);
QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = 0);
QPropertyAnimation(QObject *parent = Q_NULLPTR);
QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = Q_NULLPTR);
~QPropertyAnimation();
QObject *targetObject() const;

View File

@ -50,7 +50,7 @@ class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup
Q_PROPERTY(QAbstractAnimation* currentAnimation READ currentAnimation NOTIFY currentAnimationChanged)
public:
QSequentialAnimationGroup(QObject *parent = 0);
QSequentialAnimationGroup(QObject *parent = Q_NULLPTR);
~QSequentialAnimationGroup();
QPauseAnimation *addPause(int msecs);

View File

@ -59,7 +59,7 @@ public:
typedef QPair<qreal, QVariant> KeyValue;
typedef QVector<KeyValue> KeyValues;
QVariantAnimation(QObject *parent = 0);
QVariantAnimation(QObject *parent = Q_NULLPTR);
~QVariantAnimation();
QVariant startValue() const;
@ -88,7 +88,7 @@ Q_SIGNALS:
void valueChanged(const QVariant &value);
protected:
QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = 0);
QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
bool event(QEvent *event) Q_DECL_OVERRIDE;
void updateCurrentTime(int) Q_DECL_OVERRIDE;

View File

@ -88,7 +88,7 @@ public:
struct Q_CORE_EXPORT ConverterState {
ConverterState(ConversionFlags f = DefaultConversion)
: flags(f), remainingChars(0), invalidChars(0), d(0) { state_data[0] = state_data[1] = state_data[2] = 0; }
: flags(f), remainingChars(0), invalidChars(0), d(Q_NULLPTR) { state_data[0] = state_data[1] = state_data[2] = 0; }
~ConverterState();
ConversionFlags flags;
int remainingChars;
@ -99,9 +99,9 @@ public:
Q_DISABLE_COPY(ConverterState)
};
QString toUnicode(const char *in, int length, ConverterState *state = 0) const
QString toUnicode(const char *in, int length, ConverterState *state = Q_NULLPTR) const
{ return convertToUnicode(in, length, state); }
QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = 0) const
QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = Q_NULLPTR) const
{ return convertFromUnicode(in, length, state); }
QTextDecoder* makeDecoder(ConversionFlags flags = DefaultConversion) const;

View File

@ -109,7 +109,7 @@ public:
inline QFlags &operator=(const QFlags &other);
#endif
Q_DECL_CONSTEXPR inline QFlags(Enum f) Q_DECL_NOTHROW : i(Int(f)) {}
Q_DECL_CONSTEXPR inline QFlags(Zero = 0) Q_DECL_NOTHROW : i(0) {}
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

View File

@ -1079,7 +1079,7 @@ Q_CORE_EXPORT bool qunsetenv(const char *varName);
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT;
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT;
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=0) Q_DECL_NOEXCEPT;
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=Q_NULLPTR) Q_DECL_NOEXCEPT;
inline int qIntCast(double f) { return int(f); }
inline int qIntCast(float f) { return int(f); }

View File

@ -57,7 +57,8 @@ class QMessageLogContext
{
Q_DISABLE_COPY(QMessageLogContext)
public:
Q_DECL_CONSTEXPR QMessageLogContext() : version(2), line(0), file(0), function(0), category(0) {}
Q_DECL_CONSTEXPR QMessageLogContext()
: version(2), line(0), file(Q_NULLPTR), function(Q_NULLPTR), category(Q_NULLPTR) {}
Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName)
: version(2), line(lineNumber), file(fileName), function(functionName), category(categoryName) {}

View File

@ -51,8 +51,8 @@ class Q_CORE_EXPORT QBuffer : public QIODevice
public:
#ifndef QT_NO_QOBJECT
explicit QBuffer(QObject *parent = 0);
QBuffer(QByteArray *buf, QObject *parent = 0);
explicit QBuffer(QObject *parent = Q_NULLPTR);
QBuffer(QByteArray *buf, QObject *parent = Q_NULLPTR);
#else
QBuffer();
explicit QBuffer(QByteArray *buf);

View File

@ -134,7 +134,7 @@ protected:
#ifdef QT_NO_QOBJECT
QFile(QFilePrivate &dd);
#else
QFile(QFilePrivate &dd, QObject *parent = 0);
QFile(QFilePrivate &dd, QObject *parent = Q_NULLPTR);
#endif
private:

View File

@ -119,7 +119,7 @@ protected:
QFileDevice(QFileDevicePrivate &dd);
#else
explicit QFileDevice(QObject *parent);
QFileDevice(QFileDevicePrivate &dd, QObject *parent = 0);
QFileDevice(QFileDevicePrivate &dd, QObject *parent = Q_NULLPTR);
#endif
qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;

View File

@ -44,7 +44,7 @@ class Q_CORE_EXPORT QFileSelector : public QObject
{
Q_OBJECT
public:
explicit QFileSelector(QObject *parent = 0);
explicit QFileSelector(QObject *parent = Q_NULLPTR);
~QFileSelector();
QString select(const QString &filePath) const;

View File

@ -49,8 +49,8 @@ class Q_CORE_EXPORT QFileSystemWatcher : public QObject
Q_DECLARE_PRIVATE(QFileSystemWatcher)
public:
QFileSystemWatcher(QObject *parent = 0);
QFileSystemWatcher(const QStringList &paths, QObject *parent = 0);
QFileSystemWatcher(QObject *parent = Q_NULLPTR);
QFileSystemWatcher(const QStringList &paths, QObject *parent = Q_NULLPTR);
~QFileSystemWatcher();
bool addPath(const QString &file);

View File

@ -140,7 +140,7 @@ protected:
#ifdef QT_NO_QOBJECT
QIODevice(QIODevicePrivate &dd);
#else
QIODevice(QIODevicePrivate &dd, QObject *parent = 0);
QIODevice(QIODevicePrivate &dd, QObject *parent = Q_NULLPTR);
#endif
virtual qint64 readData(char *data, qint64 maxlen) = 0;
virtual qint64 readLineData(char *data, qint64 maxlen);

View File

@ -143,7 +143,7 @@ public:
};
Q_ENUM(ExitStatus)
explicit QProcess(QObject *parent = 0);
explicit QProcess(QObject *parent = Q_NULLPTR);
virtual ~QProcess();
void start(const QString &program, const QStringList &arguments, OpenMode mode = ReadWrite);
@ -222,7 +222,7 @@ public:
#if defined(Q_QDOC)
= QString()
#endif
, qint64 *pid = 0);
, qint64 *pid = Q_NULLPTR);
#if !defined(Q_QDOC)
static bool startDetached(const QString &program, const QStringList &arguments); // ### Qt6: merge overloads
#endif

View File

@ -58,7 +58,7 @@ class Q_CORE_EXPORT QSaveFile : public QFileDevice
public:
explicit QSaveFile(const QString &name);
explicit QSaveFile(QObject *parent = 0);
explicit QSaveFile(QObject *parent = Q_NULLPTR);
explicit QSaveFile(const QString &name, QObject *parent);
~QSaveFile();

View File

@ -105,13 +105,13 @@ public:
#ifndef QT_NO_QOBJECT
explicit QSettings(const QString &organization,
const QString &application = QString(), QObject *parent = 0);
const QString &application = QString(), QObject *parent = Q_NULLPTR);
QSettings(Scope scope, const QString &organization,
const QString &application = QString(), QObject *parent = 0);
const QString &application = QString(), QObject *parent = Q_NULLPTR);
QSettings(Format format, Scope scope, const QString &organization,
const QString &application = QString(), QObject *parent = 0);
QSettings(const QString &fileName, Format format, QObject *parent = 0);
explicit QSettings(QObject *parent = 0);
const QString &application = QString(), QObject *parent = Q_NULLPTR);
QSettings(const QString &fileName, Format format, QObject *parent = Q_NULLPTR);
explicit QSettings(QObject *parent = Q_NULLPTR);
#else
explicit QSettings(const QString &organization,
const QString &application = QString());

View File

@ -49,7 +49,7 @@ class Q_CORE_EXPORT QModelIndex
{
friend class QAbstractItemModel;
public:
Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(0) {}
Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(Q_NULLPTR) {}
// compiler-generated copy/move ctors/assignment operators are fine!
Q_DECL_CONSTEXPR inline int row() const Q_DECL_NOTHROW { return r; }
Q_DECL_CONSTEXPR inline int column() const Q_DECL_NOTHROW { return c; }
@ -61,7 +61,7 @@ public:
inline QVariant data(int role = Qt::DisplayRole) const;
inline Qt::ItemFlags flags() const;
Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const Q_DECL_NOTHROW { return m; }
Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != 0); }
Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != Q_NULLPTR); }
Q_DECL_CONSTEXPR inline bool operator==(const QModelIndex &other) const Q_DECL_NOTHROW
{ return (other.r == r) && (other.i == i) && (other.c == c) && (other.m == m); }
Q_DECL_CONSTEXPR inline bool operator!=(const QModelIndex &other) const Q_DECL_NOTHROW
@ -161,7 +161,7 @@ class Q_CORE_EXPORT QAbstractItemModel : public QObject
friend class QIdentityProxyModel;
public:
explicit QAbstractItemModel(QObject *parent = 0);
explicit QAbstractItemModel(QObject *parent = Q_NULLPTR);
virtual ~QAbstractItemModel();
Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const;
@ -276,9 +276,9 @@ protected Q_SLOTS:
void resetInternalData();
protected:
QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = 0);
QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = Q_NULLPTR);
inline QModelIndex createIndex(int row, int column, void *data = 0) const;
inline QModelIndex createIndex(int row, int column, void *data = Q_NULLPTR) const;
inline QModelIndex createIndex(int row, int column, quintptr id) const;
void encodeData(const QModelIndexList &indexes, QDataStream &stream) const;
@ -357,7 +357,7 @@ class Q_CORE_EXPORT QAbstractTableModel : public QAbstractItemModel
Q_OBJECT
public:
explicit QAbstractTableModel(QObject *parent = 0);
explicit QAbstractTableModel(QObject *parent = Q_NULLPTR);
~QAbstractTableModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
@ -383,7 +383,7 @@ class Q_CORE_EXPORT QAbstractListModel : public QAbstractItemModel
Q_OBJECT
public:
explicit QAbstractListModel(QObject *parent = 0);
explicit QAbstractListModel(QObject *parent = Q_NULLPTR);
~QAbstractListModel();
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;

View File

@ -50,7 +50,7 @@ class Q_CORE_EXPORT QAbstractProxyModel : public QAbstractItemModel
Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
public:
explicit QAbstractProxyModel(QObject *parent = 0);
explicit QAbstractProxyModel(QObject *parent = Q_NULLPTR);
~QAbstractProxyModel();
virtual void setSourceModel(QAbstractItemModel *sourceModel);

View File

@ -48,7 +48,7 @@ class Q_CORE_EXPORT QIdentityProxyModel : public QAbstractProxyModel
{
Q_OBJECT
public:
explicit QIdentityProxyModel(QObject* parent = 0);
explicit QIdentityProxyModel(QObject* parent = Q_NULLPTR);
~QIdentityProxyModel();
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;

View File

@ -170,7 +170,7 @@ public:
Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag)
Q_FLAG(SelectionFlags)
explicit QItemSelectionModel(QAbstractItemModel *model = 0);
explicit QItemSelectionModel(QAbstractItemModel *model = Q_NULLPTR);
explicit QItemSelectionModel(QAbstractItemModel *model, QObject *parent);
virtual ~QItemSelectionModel();

View File

@ -63,7 +63,7 @@ class Q_CORE_EXPORT QSortFilterProxyModel : public QAbstractProxyModel
Q_PROPERTY(int filterRole READ filterRole WRITE setFilterRole)
public:
explicit QSortFilterProxyModel(QObject *parent = 0);
explicit QSortFilterProxyModel(QObject *parent = Q_NULLPTR);
~QSortFilterProxyModel();
void setSourceModel(QAbstractItemModel *sourceModel) Q_DECL_OVERRIDE;

View File

@ -46,8 +46,8 @@ class Q_CORE_EXPORT QStringListModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit QStringListModel(QObject *parent = 0);
explicit QStringListModel(const QStringList &strings, QObject *parent = 0);
explicit QStringListModel(QObject *parent = Q_NULLPTR);
explicit QStringListModel(const QStringList &strings, QObject *parent = Q_NULLPTR);
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;

View File

@ -107,7 +107,7 @@ public:
typedef QJsonValueRef reference;
typedef QJsonValueRefPtr pointer;
inline iterator() : a(0), i(0) { }
inline iterator() : a(Q_NULLPTR), i(0) { }
explicit inline iterator(QJsonArray *array, int index) : a(array), i(index) { }
inline QJsonValueRef operator*() const { return QJsonValueRef(a, i); }
@ -152,7 +152,7 @@ public:
typedef QJsonValue reference;
typedef QJsonValuePtr pointer;
inline const_iterator() : a(0), i(0) { }
inline const_iterator() : a(Q_NULLPTR), i(0) { }
explicit inline const_iterator(const QJsonArray *array, int index) : a(array), i(index) { }
inline const_iterator(const const_iterator &o) : a(o.a), i(o.i) {}
inline const_iterator(const iterator &o) : a(o.a), i(o.i) {}

View File

@ -106,7 +106,7 @@ public:
Compact
};
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = Q_NULLPTR);
#ifdef Q_QDOC
QByteArray toJson(JsonFormat format = Indented) const;

View File

@ -105,7 +105,7 @@ public:
typedef QJsonValue value_type;
typedef QJsonValueRef reference;
Q_DECL_CONSTEXPR inline iterator() : o(0), i(0) {}
Q_DECL_CONSTEXPR inline iterator() : o(Q_NULLPTR), i(0) {}
Q_DECL_CONSTEXPR inline iterator(QJsonObject *obj, int index) : o(obj), i(index) {}
inline QString key() const { return o->keyAt(i); }
@ -147,7 +147,7 @@ public:
typedef QJsonValue value_type;
typedef QJsonValue reference;
Q_DECL_CONSTEXPR inline const_iterator() : o(0), i(0) {}
Q_DECL_CONSTEXPR inline const_iterator() : o(Q_NULLPTR), i(0) {}
Q_DECL_CONSTEXPR inline const_iterator(const QJsonObject *obj, int index)
: o(obj), i(index) {}
inline const_iterator(const iterator &other)

View File

@ -64,10 +64,10 @@ public:
{ }
};
explicit QAbstractEventDispatcher(QObject *parent = 0);
explicit QAbstractEventDispatcher(QObject *parent = Q_NULLPTR);
~QAbstractEventDispatcher();
static QAbstractEventDispatcher *instance(QThread *thread = 0);
static QAbstractEventDispatcher *instance(QThread *thread = Q_NULLPTR);
virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0;
virtual bool hasPendingEvents() = 0; // ### Qt6: remove, mark final or make protected

View File

@ -117,7 +117,7 @@ public:
static bool sendEvent(QObject *receiver, QEvent *event);
static void postEvent(QObject *receiver, QEvent *event, int priority = Qt::NormalEventPriority);
static void sendPostedEvents(QObject *receiver = 0, int event_type = 0);
static void sendPostedEvents(QObject *receiver = Q_NULLPTR, int event_type = 0);
static void removePostedEvents(QObject *receiver, int eventType = 0);
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED static bool hasPendingEvents();
@ -149,7 +149,7 @@ public:
static QString translate(const char * context,
const char * key,
const char * disambiguation = 0,
const char * disambiguation = Q_NULLPTR,
int n = -1);
#if QT_DEPRECATED_SINCE(5, 0)
enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = UnicodeUTF8, CodecForTr = UnicodeUTF8 };
@ -231,13 +231,13 @@ inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *ev
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)
#else
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = 0, int n = -1) \
QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); }
#endif
#define Q_DECLARE_TR_FUNCTIONS(context) \
public: \
static inline QString tr(const char *sourceText, const char *disambiguation = 0, int n = -1) \
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:

View File

@ -47,7 +47,7 @@ class Q_CORE_EXPORT QEventLoop : public QObject
Q_DECLARE_PRIVATE(QEventLoop)
public:
explicit QEventLoop(QObject *parent = 0);
explicit QEventLoop(QObject *parent = Q_NULLPTR);
~QEventLoop();
enum ProcessEventsFlag {

View File

@ -48,7 +48,7 @@ template <typename T> class QList;
class Q_CORE_EXPORT QMetaMethod
{
public:
Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(0),handle(0) {}
Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(Q_NULLPTR), handle(0) {}
QByteArray methodSignature() const;
QByteArray name() const;
@ -74,7 +74,7 @@ public:
bool invoke(QObject *object,
Qt::ConnectionType connectionType,
QGenericReturnArgument returnValue,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -86,7 +86,7 @@ public:
QGenericArgument val9 = QGenericArgument()) const;
inline bool invoke(QObject *object,
QGenericReturnArgument returnValue,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -102,7 +102,7 @@ public:
}
inline bool invoke(QObject *object,
Qt::ConnectionType connectionType,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -117,7 +117,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
inline bool invoke(QObject *object,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -134,7 +134,7 @@ public:
bool invokeOnGadget(void *gadget,
QGenericReturnArgument returnValue,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -145,7 +145,7 @@ public:
QGenericArgument val8 = QGenericArgument(),
QGenericArgument val9 = QGenericArgument()) const;
inline bool invokeOnGadget(void *gadget,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -160,7 +160,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
inline bool isValid() const { return mobj != 0; }
inline bool isValid() const { return mobj != Q_NULLPTR; }
#ifdef Q_QDOC
static QMetaMethod fromSignal(PointerToMemberFunction signal);
@ -204,7 +204,7 @@ inline bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2)
class Q_CORE_EXPORT QMetaEnum
{
public:
Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(0),handle(0) {}
Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(Q_NULLPTR), handle(0) {}
const char *name() const;
bool isFlag() const;
@ -215,14 +215,14 @@ public:
const char *scope() const;
int keyToValue(const char *key, bool *ok = 0) const;
int keyToValue(const char *key, bool *ok = Q_NULLPTR) const;
const char* valueToKey(int value) const;
int keysToValue(const char * keys, bool *ok = 0) const;
int keysToValue(const char * keys, bool *ok = Q_NULLPTR) const;
QByteArray valueToKeys(int value) const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
inline bool isValid() const { return name() != 0; }
inline bool isValid() const { return name() != Q_NULLPTR; }
template<typename T> static QMetaEnum fromType() {
Q_STATIC_ASSERT_X(QtPrivate::IsQEnumHelper<T>::Value,
@ -253,11 +253,11 @@ public:
bool isReadable() const;
bool isWritable() const;
bool isResettable() const;
bool isDesignable(const QObject *obj = 0) const;
bool isScriptable(const QObject *obj = 0) const;
bool isStored(const QObject *obj = 0) const;
bool isEditable(const QObject *obj = 0) const;
bool isUser(const QObject *obj = 0) const;
bool isDesignable(const QObject *obj = Q_NULLPTR) const;
bool isScriptable(const QObject *obj = Q_NULLPTR) const;
bool isStored(const QObject *obj = Q_NULLPTR) const;
bool isEditable(const QObject *obj = Q_NULLPTR) const;
bool isUser(const QObject *obj = Q_NULLPTR) const;
bool isConstant() const;
bool isFinal() const;
@ -297,7 +297,7 @@ private:
class Q_CORE_EXPORT QMetaClassInfo
{
public:
Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(0),handle(0) {}
Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(Q_NULLPTR), handle(0) {}
const char *name() const;
const char *value() const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }

View File

@ -229,7 +229,7 @@ struct AbstractDebugStreamFunction
{
typedef void (*Stream)(const AbstractDebugStreamFunction *, QDebug&, const void *);
typedef void (*Destroy)(AbstractDebugStreamFunction *);
explicit AbstractDebugStreamFunction(Stream s = 0, Destroy d = 0)
explicit AbstractDebugStreamFunction(Stream s = Q_NULLPTR, Destroy d = Q_NULLPTR)
: stream(s), destroy(d) {}
Q_DISABLE_COPY(AbstractDebugStreamFunction)
Stream stream;
@ -259,7 +259,7 @@ struct AbstractComparatorFunction
typedef bool (*LessThan)(const AbstractComparatorFunction *, const void *, const void *);
typedef bool (*Equals)(const AbstractComparatorFunction *, const void *, const void *);
typedef void (*Destroy)(AbstractComparatorFunction *);
explicit AbstractComparatorFunction(LessThan lt = 0, Equals e = 0, Destroy d = 0)
explicit AbstractComparatorFunction(LessThan lt = Q_NULLPTR, Equals e = Q_NULLPTR, Destroy d = Q_NULLPTR)
: lessThan(lt), equals(e), destroy(d) {}
Q_DISABLE_COPY(AbstractComparatorFunction)
LessThan lessThan;
@ -296,7 +296,7 @@ template<typename T>
struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
{
BuiltInEqualsComparatorFunction()
: AbstractComparatorFunction(0, equals, destroy) {}
: AbstractComparatorFunction(Q_NULLPTR, equals, destroy) {}
static bool equals(const AbstractComparatorFunction *, const void *l, const void *r)
{
const T *lhs = static_cast<const T *>(l);
@ -313,7 +313,7 @@ struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
struct AbstractConverterFunction
{
typedef bool (*Converter)(const AbstractConverterFunction *, const void *, void*);
explicit AbstractConverterFunction(Converter c = 0)
explicit AbstractConverterFunction(Converter c = Q_NULLPTR)
: convert(c) {}
Q_DISABLE_COPY(AbstractConverterFunction)
Converter convert;
@ -510,9 +510,9 @@ public:
static TypeFlags typeFlags(int type);
static const QMetaObject *metaObjectForType(int type);
static bool isRegistered(int type);
static void *create(int type, const void *copy = 0);
static void *create(int type, const void *copy = Q_NULLPTR);
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static void *construct(int type, const void *copy = 0)
QT_DEPRECATED static void *construct(int type, const void *copy = Q_NULLPTR)
{ return create(type, copy); }
#endif
static void destroy(int type, void *data);
@ -533,9 +533,9 @@ public:
inline TypeFlags flags() const;
inline const QMetaObject *metaObject() const;
inline void *create(const void *copy = 0) const;
inline void *create(const void *copy = Q_NULLPTR) const;
inline void destroy(void *data) const;
inline void *construct(void *where, const void *copy = 0) const;
inline void *construct(void *where, const void *copy = Q_NULLPTR) const;
inline void destruct(void *data) const;
public:
@ -611,7 +611,7 @@ public:
return registerConverterFunction(&f, fromTypeId, toTypeId);
}
// member function as in "double QString::toDouble(bool *ok = 0) const"
// member function as in "double QString::toDouble(bool *ok = Q_NULLPTR) const"
template<typename From, typename To>
static bool registerConverter(To(From::*function)(bool*) const)
{
@ -674,9 +674,9 @@ private:
uint sizeExtended() const;
QMetaType::TypeFlags flagsExtended() const;
const QMetaObject *metaObjectExtended() const;
void *createExtended(const void *copy = 0) const;
void *createExtended(const void *copy = Q_NULLPTR) const;
void destroyExtended(void *data) const;
void *constructExtended(void *where, const void *copy = 0) const;
void *constructExtended(void *where, const void *copy = Q_NULLPTR) const;
void destructExtended(void *data) const;
static bool registerComparatorFunction(const QtPrivate::AbstractComparatorFunction *f, int type);
@ -771,7 +771,7 @@ struct QMetaTypeFunctionHelper {
template <typename T>
struct QMetaTypeFunctionHelper<T, /* Accepted */ false> {
static void Destruct(void *) {}
static void *Construct(void *, const void *) { return 0; }
static void *Construct(void *, const void *) { return Q_NULLPTR; }
#ifndef QT_NO_DATASTREAM
static void Save(QDataStream &, const void *) {}
static void Load(QDataStream &, void *) {}
@ -1009,7 +1009,7 @@ public:
public:
template<class T> QSequentialIterableImpl(const T*p)
: _iterable(p)
, _iterator(0)
, _iterator(Q_NULLPTR)
, _metaType_id(qMetaTypeId<typename T::value_type>())
, _metaType_flags(QTypeInfo<typename T::value_type>::isPointer)
, _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities)
@ -1026,20 +1026,20 @@ public:
}
QSequentialIterableImpl()
: _iterable(0)
, _iterator(0)
: _iterable(Q_NULLPTR)
, _iterator(Q_NULLPTR)
, _metaType_id(QMetaType::UnknownType)
, _metaType_flags(0)
, _iteratorCapabilities(0)
, _size(0)
, _at(0)
, _moveToBegin(0)
, _moveToEnd(0)
, _advance(0)
, _get(0)
, _destroyIter(0)
, _equalIter(0)
, _copyIter(0)
, _size(Q_NULLPTR)
, _at(Q_NULLPTR)
, _moveToBegin(Q_NULLPTR)
, _moveToEnd(Q_NULLPTR)
, _advance(Q_NULLPTR)
, _get(Q_NULLPTR)
, _destroyIter(Q_NULLPTR)
, _equalIter(Q_NULLPTR)
, _copyIter(Q_NULLPTR)
{
}
@ -1195,21 +1195,21 @@ public:
}
QAssociativeIterableImpl()
: _iterable(0)
: _iterable(Q_NULLPTR)
, _metaType_id_key(QMetaType::UnknownType)
, _metaType_flags_key(0)
, _metaType_id_value(QMetaType::UnknownType)
, _metaType_flags_value(0)
, _size(0)
, _find(0)
, _begin(0)
, _end(0)
, _advance(0)
, _getKey(0)
, _getValue(0)
, _destroyIter(0)
, _equalIter(0)
, _copyIter(0)
, _size(Q_NULLPTR)
, _find(Q_NULLPTR)
, _begin(Q_NULLPTR)
, _end(Q_NULLPTR)
, _advance(Q_NULLPTR)
, _getKey(Q_NULLPTR)
, _getValue(Q_NULLPTR)
, _destroyIter(Q_NULLPTR)
, _equalIter(Q_NULLPTR)
, _copyIter(Q_NULLPTR)
{
}
@ -1277,9 +1277,9 @@ public:
}
QPairVariantInterfaceImpl()
: _pair(0)
, _getFirst(0)
, _getSecond(0)
: _pair(Q_NULLPTR)
, _getFirst(Q_NULLPTR)
, _getSecond(Q_NULLPTR)
{
}
@ -1354,7 +1354,7 @@ namespace QtPrivate
#endif
static no_type checkType(...);
Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
enum { Value = sizeof(checkType(static_cast<T*>(0))) == sizeof(yes_type) };
enum { Value = sizeof(checkType(static_cast<T*>(Q_NULLPTR))) == sizeof(yes_type) };
};
template<typename T, typename Enable = void>
@ -1391,7 +1391,7 @@ QT_WARNING_POP
template<typename T, typename Enable = void>
struct MetaObjectForType
{
static inline const QMetaObject *value() { return 0; }
static inline const QMetaObject *value() { return Q_NULLPTR; }
};
template<>
struct MetaObjectForType<void>
@ -1692,7 +1692,7 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
template <typename T>
int qRegisterMetaType(const char *typeName
#ifndef Q_QDOC
, T * dummy = 0
, T * dummy = Q_NULLPTR
, typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
@ -1709,7 +1709,7 @@ int qRegisterMetaType(const char *typeName
template <typename T>
void qRegisterMetaTypeStreamOperators(const char *typeName
#ifndef Q_QDOC
, T * /* dummy */ = 0
, T * /* dummy */ = Q_NULLPTR
#endif
)
{
@ -2095,7 +2095,7 @@ inline QMetaType::QMetaType(const ExtensionFlag extensionFlags, const QMetaTypeI
, m_loadOp(loadOp)
, m_constructor(constructor)
, m_destructor(destructor)
, m_extension(0)
, m_extension(Q_NULLPTR)
, m_size(size)
, m_typeFlags(theTypeFlags)
, m_extensionFlags(extensionFlags)

View File

@ -110,23 +110,23 @@ class Q_CORE_EXPORT QObject
Q_DECLARE_PRIVATE(QObject)
public:
Q_INVOKABLE explicit QObject(QObject *parent=0);
Q_INVOKABLE explicit QObject(QObject *parent=Q_NULLPTR);
virtual ~QObject();
virtual bool event(QEvent *);
virtual bool eventFilter(QObject *, QEvent *);
#ifdef Q_QDOC
static QString tr(const char *sourceText, const char *comment = 0, int n = -1);
static QString trUtf8(const char *sourceText, const char *comment = 0, int n = -1);
static QString tr(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
static QString trUtf8(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
virtual const QMetaObject *metaObject() const;
static const QMetaObject staticMetaObject;
#endif
#ifdef QT_NO_TRANSLATION
static QString tr(const char *sourceText, const char * = 0, int = -1)
static QString tr(const char *sourceText, const char * = Q_NULLPTR, int = -1)
{ return QString::fromUtf8(sourceText); }
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = 0, int = -1)
QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = Q_NULLPTR, int = -1)
{ return QString::fromUtf8(sourceText); }
#endif
#endif //QT_NO_TRANSLATION
@ -228,7 +228,7 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
const int *types = 0;
const int *types = Q_NULLPTR;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
@ -268,11 +268,11 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
const int *types = 0;
const int *types = Q_NULLPTR;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, 0,
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
new QtPrivate::QStaticSlotObject<Func2,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
typename SignalType::ReturnType>(slot),
@ -338,11 +338,11 @@ public:
Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
"No Q_OBJECT in the class with the signal");
const int *types = 0;
const int *types = Q_NULLPTR;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, 0,
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
new QtPrivate::QFunctorSlotObject<Func2, SlotArgumentCount,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotArgumentCount>::Value,
typename SignalType::ReturnType>(slot),
@ -354,11 +354,11 @@ public:
const QObject *receiver, const char *member);
static bool disconnect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &member);
inline bool disconnect(const char *signal = 0,
const QObject *receiver = 0, const char *member = 0) const
inline bool disconnect(const char *signal = Q_NULLPTR,
const QObject *receiver = Q_NULLPTR, const char *member = Q_NULLPTR) const
{ return disconnect(this, signal, receiver, member); }
inline bool disconnect(const QObject *receiver, const char *member = 0) const
{ return disconnect(this, 0, receiver, member); }
inline bool disconnect(const QObject *receiver, const char *member = Q_NULLPTR) const
{ return disconnect(this, Q_NULLPTR, receiver, member); }
static bool disconnect(const QMetaObject::Connection &);
#ifdef Q_QDOC
@ -385,7 +385,7 @@ public:
static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const QObject *receiver, void **zero)
{
// This is the overload for when one wish to disconnect a signal from any slot. (slot=0)
// This is the overload for when one wish to disconnect a signal from any slot. (slot=Q_NULLPTR)
// Since the function template parameter cannot be deduced from '0', we use a
// dummy void ** parameter that must be equal to 0
Q_ASSERT(!zero);
@ -412,14 +412,14 @@ public:
#endif // QT_NO_USERDATA
Q_SIGNALS:
void destroyed(QObject * = 0);
void destroyed(QObject * = Q_NULLPTR);
void objectNameChanged(const QString &objectName, QPrivateSignal);
public:
inline QObject *parent() const { return d_ptr->parent; }
inline bool inherits(const char *classname) const
{ return const_cast<QObject *>(this)->qt_metacast(classname) != 0; }
{ return const_cast<QObject *>(this)->qt_metacast(classname) != Q_NULLPTR; }
public Q_SLOTS:
void deleteLater();
@ -438,7 +438,7 @@ protected:
virtual void disconnectNotify(const QMetaMethod &signal);
protected:
QObject(QObjectPrivate &dd, QObject *parent = 0);
QObject(QObjectPrivate &dd, QObject *parent = Q_NULLPTR);
protected:
QScopedPointer<QObjectData> d_ptr;
@ -529,16 +529,16 @@ inline T qobject_cast(const QObject *object)
template <class T> inline const char * qobject_interface_iid()
{ return 0; }
{ return Q_NULLPTR; }
#ifndef Q_MOC_RUN
# define Q_DECLARE_INTERFACE(IFace, IId) \
template <> inline const char *qobject_interface_iid<IFace *>() \
{ return IId; } \
template <> inline IFace *qobject_cast<IFace *>(QObject *object) \
{ return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : 0)); } \
{ return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : Q_NULLPTR)); } \
template <> inline IFace *qobject_cast<IFace *>(const QObject *object) \
{ return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0)); }
{ return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : Q_NULLPTR)); }
#endif // Q_MOC_RUN
#ifndef QT_NO_DEBUG_STREAM
@ -584,7 +584,7 @@ QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked(other.m_blocked),
m_inhibited(other.m_inhibited)
{
other.m_o = 0;
other.m_o = Q_NULLPTR;
}
QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
@ -598,7 +598,7 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked = other.m_blocked;
m_inhibited = other.m_inhibited;
// disable other:
other.m_o = 0;
other.m_o = Q_NULLPTR;
}
return *this;
}

View File

@ -90,9 +90,9 @@ namespace QtPrivate {
{ enum { Value = QMetaTypeId2<Arg>::Defined && TypesAreDeclaredMetaType<List<Tail...>>::Value }; };
template <typename ArgList, bool Declared = TypesAreDeclaredMetaType<ArgList>::Value > struct ConnectionTypes
{ static const int *types() { return 0; } };
{ static const int *types() { return Q_NULLPTR; } };
template <> struct ConnectionTypes<List<>, true>
{ static const int *types() { return 0; } };
{ static const int *types() { return Q_NULLPTR; } };
template <typename... Args> struct ConnectionTypes<List<Args...>, true>
{ static const int *types() { static const int t[sizeof...(Args) + 1] = { (QtPrivate::QMetaTypeIdHelper<Args>::qt_metatype_id())..., 0 }; return t; } };
#endif
@ -118,10 +118,10 @@ namespace QtPrivate {
inline int ref() Q_DECL_NOTHROW { return m_ref.ref(); }
inline void destroyIfLastRef() Q_DECL_NOTHROW
{ if (!m_ref.deref()) m_impl(Destroy, this, 0, 0, 0); }
{ if (!m_ref.deref()) m_impl(Destroy, this, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR); }
inline bool compare(void **a) { bool ret; m_impl(Compare, this, 0, a, &ret); return ret; }
inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, 0); }
inline bool compare(void **a) { bool ret; m_impl(Compare, this, Q_NULLPTR, a, &ret); return ret; }
inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, Q_NULLPTR); }
protected:
~QSlotObjectBase() {}
private:

View File

@ -258,7 +258,7 @@ class QMetaClassInfo;
class Q_CORE_EXPORT QGenericArgument
{
public:
inline QGenericArgument(const char *aName = 0, const void *aData = 0)
inline QGenericArgument(const char *aName = Q_NULLPTR, const void *aData = Q_NULLPTR)
: _data(aData), _name(aName) {}
inline void *data() const { return const_cast<void *>(_data); }
inline const char *name() const { return _name; }
@ -271,7 +271,7 @@ private:
class Q_CORE_EXPORT QGenericReturnArgument: public QGenericArgument
{
public:
inline QGenericReturnArgument(const char *aName = 0, void *aData = 0)
inline QGenericReturnArgument(const char *aName = Q_NULLPTR, void *aData = Q_NULLPTR)
: QGenericArgument(aName, aData)
{}
};
@ -351,7 +351,7 @@ struct Q_CORE_EXPORT QMetaObject
// internal index-based connect
static Connection connect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index,
int type = 0, int *types = 0);
int type = 0, int *types = Q_NULLPTR);
// internal index-based disconnect
static bool disconnect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index);
@ -368,7 +368,7 @@ struct Q_CORE_EXPORT QMetaObject
static bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType,
QGenericReturnArgument ret,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -381,7 +381,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
QGenericReturnArgument ret,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -398,7 +398,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType type,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -414,7 +414,7 @@ struct Q_CORE_EXPORT QMetaObject
}
static inline bool invokeMethod(QObject *obj, const char *member,
QGenericArgument val0 = QGenericArgument(0),
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -429,7 +429,7 @@ struct Q_CORE_EXPORT QMetaObject
val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
QObject *newInstance(QGenericArgument val0 = QGenericArgument(0),
QObject *newInstance(QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -485,11 +485,11 @@ public:
operator bool() const;
#else
typedef void *Connection::*RestrictedBool;
operator RestrictedBool() const { return d_ptr ? &Connection::d_ptr : 0; }
operator RestrictedBool() const { return d_ptr ? &Connection::d_ptr : Q_NULLPTR; }
#endif
#ifdef Q_COMPILER_RVALUE_REFS
inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = 0; }
inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = Q_NULLPTR; }
inline Connection &operator=(Connection &&other)
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif

View File

@ -68,8 +68,8 @@ public:
UnknownError
};
QSharedMemory(QObject *parent = 0);
QSharedMemory(const QString &key, QObject *parent = 0);
QSharedMemory(QObject *parent = Q_NULLPTR);
QSharedMemory(const QString &key, QObject *parent = Q_NULLPTR);
~QSharedMemory();
void setKey(const QString &key);

View File

@ -45,7 +45,7 @@ class Q_CORE_EXPORT QSignalMapper : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QSignalMapper)
public:
explicit QSignalMapper(QObject *parent = 0);
explicit QSignalMapper(QObject *parent = Q_NULLPTR);
~QSignalMapper();
void setMapping(QObject *sender, int id);

View File

@ -47,7 +47,7 @@ class Q_CORE_EXPORT QSocketNotifier : public QObject
public:
enum Type { Read, Write, Exception };
QSocketNotifier(qintptr socket, Type, QObject *parent = 0);
QSocketNotifier(qintptr socket, Type, QObject *parent = Q_NULLPTR);
~QSocketNotifier();
qintptr socket() const;

View File

@ -53,7 +53,7 @@ class Q_CORE_EXPORT QTimer : public QObject
Q_PROPERTY(Qt::TimerType timerType READ timerType WRITE setTimerType)
Q_PROPERTY(bool active READ isActive)
public:
explicit QTimer(QObject *parent = 0);
explicit QTimer(QObject *parent = Q_NULLPTR);
~QTimer();
inline bool isActive() const { return id >= 0; }

View File

@ -49,11 +49,11 @@ class Q_CORE_EXPORT QTranslator : public QObject
{
Q_OBJECT
public:
explicit QTranslator(QObject *parent = 0);
explicit QTranslator(QObject *parent = Q_NULLPTR);
~QTranslator();
virtual QString translate(const char *context, const char *sourceText,
const char *disambiguation = 0, int n = -1) const;
const char *disambiguation = Q_NULLPTR, int n = -1) const;
virtual bool isEmpty() const;

View File

@ -278,14 +278,14 @@ class Q_CORE_EXPORT QVariant
void detach();
inline bool isDetached() const;
int toInt(bool *ok = 0) const;
uint toUInt(bool *ok = 0) const;
qlonglong toLongLong(bool *ok = 0) const;
qulonglong toULongLong(bool *ok = 0) const;
int toInt(bool *ok = Q_NULLPTR) const;
uint toUInt(bool *ok = Q_NULLPTR) const;
qlonglong toLongLong(bool *ok = Q_NULLPTR) const;
qulonglong toULongLong(bool *ok = Q_NULLPTR) const;
bool toBool() const;
double toDouble(bool *ok = 0) const;
float toFloat(bool *ok = 0) const;
qreal toReal(bool *ok = 0) const;
double toDouble(bool *ok = Q_NULLPTR) const;
float toFloat(bool *ok = Q_NULLPTR) const;
qreal toReal(bool *ok = Q_NULLPTR) const;
QByteArray toByteArray() const;
QBitArray toBitArray() const;
QString toString() const;
@ -364,7 +364,7 @@ class Q_CORE_EXPORT QVariant
struct Private
{
inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true)
{ data.ptr = 0; }
{ data.ptr = Q_NULLPTR; }
// Internal constructor for initialized variants.
explicit inline Private(uint variantType) Q_DECL_NOTHROW

View File

@ -59,10 +59,10 @@ public:
Q_FLAG(LoadHint)
Q_FLAG(LoadHints)
explicit QLibrary(QObject *parent = 0);
explicit QLibrary(const QString& fileName, QObject *parent = 0);
explicit QLibrary(const QString& fileName, int verNum, QObject *parent = 0);
explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = 0);
explicit QLibrary(QObject *parent = Q_NULLPTR);
explicit QLibrary(const QString& fileName, QObject *parent = Q_NULLPTR);
explicit QLibrary(const QString& fileName, int verNum, QObject *parent = Q_NULLPTR);
explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = Q_NULLPTR);
~QLibrary();
QFunctionPointer resolve(const char *symbol);

View File

@ -50,8 +50,8 @@ class Q_CORE_EXPORT QPluginLoader : public QObject
Q_PROPERTY(QString fileName READ fileName WRITE setFileName)
Q_PROPERTY(QLibrary::LoadHints loadHints READ loadHints WRITE setLoadHints)
public:
explicit QPluginLoader(QObject *parent = 0);
explicit QPluginLoader(const QString &fileName, QObject *parent = 0);
explicit QPluginLoader(QObject *parent = Q_NULLPTR);
explicit QPluginLoader(const QString &fileName, QObject *parent = Q_NULLPTR);
~QPluginLoader();
QObject *instance();

View File

@ -63,7 +63,7 @@ Q_SIGNALS:
void activeChanged(bool active);
protected:
QAbstractState(QState *parent = 0);
QAbstractState(QState *parent = Q_NULLPTR);
virtual void onEntry(QEvent *event) = 0;
virtual void onExit(QEvent *event) = 0;

View File

@ -67,7 +67,7 @@ public:
};
Q_ENUM(TransitionType)
QAbstractTransition(QState *sourceState = 0);
QAbstractTransition(QState *sourceState = Q_NULLPTR);
virtual ~QAbstractTransition();
QState *sourceState() const;

View File

@ -49,8 +49,8 @@ class Q_CORE_EXPORT QEventTransition : public QAbstractTransition
Q_PROPERTY(QObject* eventSource READ eventSource WRITE setEventSource)
Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType)
public:
QEventTransition(QState *sourceState = 0);
QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = 0);
QEventTransition(QState *sourceState = Q_NULLPTR);
QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = Q_NULLPTR);
~QEventTransition();
QObject *eventSource() const;

View File

@ -46,7 +46,7 @@ class Q_CORE_EXPORT QFinalState : public QAbstractState
{
Q_OBJECT
public:
QFinalState(QState *parent = 0);
QFinalState(QState *parent = Q_NULLPTR);
~QFinalState();
protected:

View File

@ -54,8 +54,8 @@ public:
};
Q_ENUM(HistoryType)
QHistoryState(QState *parent = 0);
QHistoryState(HistoryType type, QState *parent = 0);
QHistoryState(QState *parent = Q_NULLPTR);
QHistoryState(HistoryType type, QState *parent = Q_NULLPTR);
~QHistoryState();
QAbstractState *defaultState() const;

View File

@ -49,9 +49,9 @@ class Q_CORE_EXPORT QSignalTransition : public QAbstractTransition
Q_PROPERTY(QByteArray signal READ signal WRITE setSignal NOTIFY signalChanged)
public:
QSignalTransition(QState *sourceState = 0);
QSignalTransition(QState *sourceState = Q_NULLPTR);
QSignalTransition(const QObject *sender, const char *signal,
QState *sourceState = 0);
QState *sourceState = Q_NULLPTR);
~QSignalTransition();
QObject *senderObject() const;

View File

@ -66,8 +66,8 @@ public:
};
Q_ENUM(RestorePolicy)
QState(QState *parent = 0);
QState(ChildMode childMode, QState *parent = 0);
QState(QState *parent = Q_NULLPTR);
QState(ChildMode childMode, QState *parent = Q_NULLPTR);
~QState();
QAbstractState *errorState() const;

View File

@ -104,8 +104,8 @@ public:
NoCommonAncestorForTransitionError
};
explicit QStateMachine(QObject *parent = 0);
explicit QStateMachine(QState::ChildMode childMode, QObject *parent = 0);
explicit QStateMachine(QObject *parent = Q_NULLPTR);
explicit QStateMachine(QState::ChildMode childMode, QObject *parent = Q_NULLPTR);
~QStateMachine();
void addState(QAbstractState *state);

View File

@ -84,7 +84,7 @@ class Base;
class Q_CORE_EXPORT ExceptionHolder
{
public:
ExceptionHolder(QException *exception = 0);
ExceptionHolder(QException *exception = Q_NULLPTR);
ExceptionHolder(const ExceptionHolder &other);
void operator=(const ExceptionHolder &other);
~ExceptionHolder();

View File

@ -299,7 +299,7 @@ public:
void reportResult(const void *, int) { }
void reportResults(const QVector<void> &, int) { }
void reportFinished(const void * = 0) { QFutureInterfaceBase::reportFinished(); }
void reportFinished(const void * = Q_NULLPTR) { QFutureInterfaceBase::reportFinished(); }
};
QT_END_NAMESPACE

View File

@ -52,7 +52,7 @@ class Q_CORE_EXPORT QFutureWatcherBase : public QObject
Q_DECLARE_PRIVATE(QFutureWatcherBase)
public:
explicit QFutureWatcherBase(QObject *parent = 0);
explicit QFutureWatcherBase(QObject *parent = Q_NULLPTR);
// de-inline dtor
int progressValue() const;
@ -179,7 +179,7 @@ template <>
class QFutureWatcher<void> : public QFutureWatcherBase
{
public:
explicit QFutureWatcher(QObject *_parent = 0)
explicit QFutureWatcher(QObject *_parent = Q_NULLPTR)
: QFutureWatcherBase(_parent)
{ }
~QFutureWatcher()

View File

@ -73,16 +73,16 @@ public:
private:
inline bool fastTryLock() Q_DECL_NOTHROW {
return d_ptr.testAndSetAcquire(0, dummyLocked());
return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked());
}
inline bool fastTryUnlock() Q_DECL_NOTHROW {
return d_ptr.testAndSetRelease(dummyLocked(), 0);
return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR);
}
inline bool fastTryLock(QMutexData *&current) Q_DECL_NOTHROW {
return d_ptr.testAndSetAcquire(0, dummyLocked(), current);
return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked(), current);
}
inline bool fastTryUnlock(QMutexData *&current) Q_DECL_NOTHROW {
return d_ptr.testAndSetRelease(dummyLocked(), 0, current);
return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR, current);
}
void lockInternal() QT_MUTEX_LOCK_NOEXCEPT;

View File

@ -61,8 +61,8 @@ class ResultItem
public:
ResultItem(const void *_result, int _count) : m_count(_count), result(_result) { } // contruct with vector of results
ResultItem(const void *_result) : m_count(0), result(_result) { } // construct with result
ResultItem() : m_count(0), result(0) { }
bool isValid() const { return result != 0; }
ResultItem() : m_count(0), result(Q_NULLPTR) { }
bool isValid() const { return result != Q_NULLPTR; }
bool isVector() const { return m_count != 0; }
int count() const { return (m_count == 0) ? 1 : m_count; }
int m_count; // result is either a pointer to a result or to a vector of results,

View File

@ -55,7 +55,7 @@ public:
static int idealThreadCount() Q_DECL_NOTHROW;
static void yieldCurrentThread();
explicit QThread(QObject *parent = 0);
explicit QThread(QObject *parent = Q_NULLPTR);
~QThread();
enum Priority {
@ -116,7 +116,7 @@ protected:
static void setTerminationEnabled(bool enabled = true);
protected:
QThread(QThreadPrivate &dd, QObject *parent = 0);
QThread(QThreadPrivate &dd, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QThread)

View File

@ -55,7 +55,7 @@ class Q_CORE_EXPORT QThreadPool : public QObject
friend class QFutureInterfaceBase;
public:
QThreadPool(QObject *parent = 0);
QThreadPool(QObject *parent = Q_NULLPTR);
~QThreadPool();
static QThreadPool *globalInstance();

View File

@ -132,7 +132,7 @@ struct QTypedArrayData
typedef T *pointer;
typedef T &reference;
inline iterator() : i(0) {}
inline iterator() : i(Q_NULLPTR) {}
inline iterator(T *n) : i(n) {}
inline iterator(const iterator &o): i(o.i){} // #### Qt 6: remove, the implicit version is fine
inline T &operator*() const { return *i; }
@ -166,7 +166,7 @@ struct QTypedArrayData
typedef const T *pointer;
typedef const T &reference;
inline const_iterator() : i(0) {}
inline const_iterator() : i(Q_NULLPTR) {}
inline const_iterator(const T *n) : i(n) {}
inline const_iterator(const const_iterator &o): i(o.i) {} // #### Qt 6: remove, the default version is fine
inline explicit const_iterator(const iterator &o): i(o.i) {}

View File

@ -335,16 +335,16 @@ public:
inline QT_ASCII_CAST_WARN bool operator>=(const QString &s2) const;
#endif
short toShort(bool *ok = 0, int base = 10) const;
ushort toUShort(bool *ok = 0, int base = 10) const;
int toInt(bool *ok = 0, int base = 10) const;
uint toUInt(bool *ok = 0, int base = 10) const;
long toLong(bool *ok = 0, int base = 10) const;
ulong toULong(bool *ok = 0, int base = 10) const;
qlonglong toLongLong(bool *ok = 0, int base = 10) const;
qulonglong toULongLong(bool *ok = 0, int base = 10) const;
float toFloat(bool *ok = 0) const;
double toDouble(bool *ok = 0) const;
short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
int toInt(bool *ok = Q_NULLPTR, int base = 10) const;
uint toUInt(bool *ok = Q_NULLPTR, int base = 10) const;
long toLong(bool *ok = Q_NULLPTR, int base = 10) const;
ulong toULong(bool *ok = Q_NULLPTR, int base = 10) const;
qlonglong toLongLong(bool *ok = Q_NULLPTR, int base = 10) const;
qulonglong toULongLong(bool *ok = Q_NULLPTR, int base = 10) const;
float toFloat(bool *ok = Q_NULLPTR) const;
double toDouble(bool *ok = Q_NULLPTR) const;
QByteArray toBase64(Base64Options options) const;
QByteArray toBase64() const; // ### Qt6 merge with previous
QByteArray toHex() const;

View File

@ -61,7 +61,7 @@ protected:
#endif
public:
inline QByteArray join() const
{ return QtPrivate::QByteArrayList_join(self(), 0, 0); }
{ return QtPrivate::QByteArrayList_join(self(), Q_NULLPTR, 0); }
inline QByteArray join(const QByteArray &sep) const
{ return QtPrivate::QByteArrayList_join(self(), sep.constData(), sep.size()); }
inline QByteArray join(char sep) const

View File

@ -83,7 +83,7 @@ public:
QCollator &operator=(const QCollator &);
#ifdef Q_COMPILER_RVALUE_REFS
QCollator(QCollator &&other) Q_DECL_NOTHROW
: d(other.d) { other.d = 0; }
: d(other.d) { other.d = Q_NULLPTR; }
QCollator &operator=(QCollator &&other) Q_DECL_NOTHROW
{ swap(other); return *this; }
#endif

View File

@ -74,7 +74,7 @@ public:
int dayOfYear() const;
int daysInMonth() const;
int daysInYear() const;
int weekNumber(int *yearNum = 0) const;
int weekNumber(int *yearNum = Q_NULLPTR) const;
#ifndef QT_NO_TEXTDATE
static QString shortMonthName(int month, MonthNameType type = DateFormat);

View File

@ -75,7 +75,7 @@ public:
QEasingCurve &operator=(const QEasingCurve &other)
{ if ( this != &other ) { QEasingCurve copy(other); swap(copy); } return *this; }
#ifdef Q_COMPILER_RVALUE_REFS
QEasingCurve(QEasingCurve &&other) : d_ptr(other.d_ptr) { other.d_ptr = 0; }
QEasingCurve(QEasingCurve &&other) : d_ptr(other.d_ptr) { other.d_ptr = Q_NULLPTR; }
QEasingCurve &operator=(QEasingCurve &&other)
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif

View File

@ -306,7 +306,7 @@ public:
typedef T *pointer;
typedef T &reference;
inline iterator() : i(0) { }
inline iterator() : i(Q_NULLPTR) { }
explicit inline iterator(void *node) : i(reinterpret_cast<QHashData::Node *>(node)) { }
inline const Key &key() const { return concrete(i)->key; }
@ -363,7 +363,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
inline const_iterator() : i(0) { }
inline const_iterator() : i(Q_NULLPTR) { }
explicit inline const_iterator(void *node)
: i(reinterpret_cast<QHashData::Node *>(node)) { }
#ifdef QT_STRICT_ITERATORS
@ -451,7 +451,7 @@ public:
private:
void detach_helper();
void freeData(QHashData *d);
Node **findNode(const Key &key, uint *hp = 0) const;
Node **findNode(const Key &key, uint *hp = Q_NULLPTR) const;
Node **findNode(const Key &key, uint h) const;
Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
void deleteNode(Node *node);
@ -496,7 +496,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
{
Node *concreteNode = concrete(node);
new (newNode) Node(concreteNode->key, concreteNode->value, concreteNode->h, 0);
new (newNode) Node(concreteNode->key, concreteNode->value, concreteNode->h, Q_NULLPTR);
}
template <class Key, class T>

View File

@ -871,23 +871,23 @@ public:
QString nativeLanguageName() const;
QString nativeCountryName() const;
short toShort(const QString &s, bool *ok = 0) const;
ushort toUShort(const QString &s, bool *ok = 0) const;
int toInt(const QString &s, bool *ok = 0) const;
uint toUInt(const QString &s, bool *ok = 0) const;
qlonglong toLongLong(const QString &s, bool *ok = 0) const;
qulonglong toULongLong(const QString &s, bool *ok = 0) const;
float toFloat(const QString &s, bool *ok = 0) const;
double toDouble(const QString &s, bool *ok = 0) const;
short toShort(const QString &s, bool *ok = Q_NULLPTR) const;
ushort toUShort(const QString &s, bool *ok = Q_NULLPTR) const;
int toInt(const QString &s, bool *ok = Q_NULLPTR) const;
uint toUInt(const QString &s, bool *ok = Q_NULLPTR) const;
qlonglong toLongLong(const QString &s, bool *ok = Q_NULLPTR) const;
qulonglong toULongLong(const QString &s, bool *ok = Q_NULLPTR) const;
float toFloat(const QString &s, bool *ok = Q_NULLPTR) const;
double toDouble(const QString &s, bool *ok = Q_NULLPTR) const;
short toShort(const QStringRef &s, bool *ok = 0) const;
ushort toUShort(const QStringRef &s, bool *ok = 0) const;
int toInt(const QStringRef &s, bool *ok = 0) const;
uint toUInt(const QStringRef &s, bool *ok = 0) const;
qlonglong toLongLong(const QStringRef &s, bool *ok = 0) const;
qulonglong toULongLong(const QStringRef &s, bool *ok = 0) const;
float toFloat(const QStringRef &s, bool *ok = 0) const;
double toDouble(const QStringRef &s, bool *ok = 0) const;
short toShort(const QStringRef &s, bool *ok = Q_NULLPTR) const;
ushort toUShort(const QStringRef &s, bool *ok = Q_NULLPTR) const;
int toInt(const QStringRef &s, bool *ok = Q_NULLPTR) const;
uint toUInt(const QStringRef &s, bool *ok = Q_NULLPTR) const;
qlonglong toLongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const;
qulonglong toULongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const;
float toFloat(const QStringRef &s, bool *ok = Q_NULLPTR) const;
double toDouble(const QStringRef &s, bool *ok = Q_NULLPTR) const;
QString toString(qlonglong i) const;
QString toString(qulonglong i) const;

View File

@ -148,7 +148,7 @@ template <class Key, class T>
inline QMapNode<Key, T> *QMapNode<Key, T>::lowerBound(const Key &akey)
{
QMapNode<Key, T> *n = this;
QMapNode<Key, T> *lastNode = 0;
QMapNode<Key, T> *lastNode = Q_NULLPTR;
while (n) {
if (!qMapLessThanKey(n->key, akey)) {
lastNode = n;
@ -164,7 +164,7 @@ template <class Key, class T>
inline QMapNode<Key, T> *QMapNode<Key, T>::upperBound(const Key &akey)
{
QMapNode<Key, T> *n = this;
QMapNode<Key, T> *lastNode = 0;
QMapNode<Key, T> *lastNode = Q_NULLPTR;
while (n) {
if (qMapLessThanKey(akey, n->key)) {
lastNode = n;
@ -216,7 +216,7 @@ struct QMapData : public QMapDataBase
Node *findNode(const Key &akey) const;
void nodeRange(const Key &akey, Node **firstNode, Node **lastNode);
Node *createNode(const Key &k, const T &v, Node *parent = 0, bool left = false)
Node *createNode(const Key &k, const T &v, Node *parent = Q_NULLPTR, bool left = false)
{
Node *n = static_cast<Node *>(QMapDataBase::createNode(sizeof(Node), Q_ALIGNOF(Node),
parent, left));
@ -257,13 +257,13 @@ QMapNode<Key, T> *QMapNode<Key, T>::copy(QMapData<Key, T> *d) const
n->left = leftNode()->copy(d);
n->left->setParent(n);
} else {
n->left = 0;
n->left = Q_NULLPTR;
}
if (right) {
n->right = rightNode()->copy(d);
n->right->setParent(n);
} else {
n->right = 0;
n->right = Q_NULLPTR;
}
return n;
}
@ -284,7 +284,7 @@ QMapNode<Key, T> *QMapData<Key, T>::findNode(const Key &akey) const
if (lb && !qMapLessThanKey(akey, lb->key))
return lb;
}
return 0;
return Q_NULLPTR;
}
@ -300,10 +300,10 @@ void QMapData<Key, T>::nodeRange(const Key &akey, QMapNode<Key, T> **firstNode,
} else if (qMapLessThanKey(n->key, akey)) {
n = n->rightNode();
} else {
*firstNode = n->leftNode() ? n->leftNode()->lowerBound(akey) : 0;
*firstNode = n->leftNode() ? n->leftNode()->lowerBound(akey) : Q_NULLPTR;
if (!*firstNode)
*firstNode = n;
*lastNode = n->rightNode() ? n->rightNode()->upperBound(akey) : 0;
*lastNode = n->rightNode() ? n->rightNode()->upperBound(akey) : Q_NULLPTR;
if (!*lastNode)
*lastNode = l;
return;
@ -412,7 +412,7 @@ public:
typedef T *pointer;
typedef T &reference;
inline iterator() : i(0) { }
inline iterator() : i(Q_NULLPTR) { }
inline iterator(Node *node) : i(node) { }
inline const Key &key() const { return i->key; }
@ -469,7 +469,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
inline const_iterator() : i(0) { }
inline const_iterator() : i(Q_NULLPTR) { }
inline const_iterator(const Node *node) : i(node) { }
#ifdef QT_STRICT_ITERATORS
explicit inline const_iterator(const iterator &o)
@ -650,7 +650,7 @@ Q_INLINE_TEMPLATE int QMap<Key, T>::count(const Key &akey) const
template <class Key, class T>
Q_INLINE_TEMPLATE bool QMap<Key, T>::contains(const Key &akey) const
{
return d->findNode(akey) != 0;
return d->findNode(akey) != Q_NULLPTR;
}
template <class Key, class T>
@ -659,7 +659,7 @@ Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key
detach();
Node *n = d->root();
Node *y = d->end();
Node *lastNode = 0;
Node *lastNode = Q_NULLPTR;
bool left = true;
while (n) {
y = n;
@ -734,15 +734,15 @@ typename QMap<Key, T>::iterator QMap<Key, T>::insert(const_iterator pos, const K
}
// we need to insert (not overwrite)
if (prev->right == 0) {
if (prev->right == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, prev, false);
return iterator(z);
}
if (next->left == 0) {
if (next->left == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, next, true);
return iterator(z);
}
Q_ASSERT(false); // We should have prev->right == 0 or next->left == 0.
Q_ASSERT(false); // We should have prev->right == Q_NULLPTR or next->left == Q_NULLPTR.
return this->insert(akey, avalue);
}
}
@ -756,7 +756,7 @@ Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(cons
Node* y = d->end();
Node* x = static_cast<Node *>(d->root());
bool left = true;
while (x != 0) {
while (x != Q_NULLPTR) {
left = !qMapLessThanKey(x->key, akey);
y = x;
x = left ? x->leftNode() : x->rightNode();
@ -803,15 +803,15 @@ typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const_iterator pos, co
return this->insertMulti(akey, avalue); // ignore hint
// Hint is ok - do insert
if (prev->right == 0) {
if (prev->right == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, prev, false);
return iterator(z);
}
if (next->left == 0) {
if (next->left == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, next, true);
return iterator(z);
}
Q_ASSERT(false); // We should have prev->right == 0 or next->left == 0.
Q_ASSERT(false); // We should have prev->right == Q_NULLPTR or next->left == Q_NULLPTR.
return this->insertMulti(akey, avalue);
}
}
@ -1057,7 +1057,7 @@ Q_OUTOFLINE_TEMPLATE QList<T> QMap<Key, T>::values(const Key &akey) const
template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::const_iterator QMap<Key, T>::lowerBound(const Key &akey) const
{
Node *lb = d->root() ? d->root()->lowerBound(akey) : 0;
Node *lb = d->root() ? d->root()->lowerBound(akey) : Q_NULLPTR;
if (!lb)
lb = d->end();
return const_iterator(lb);
@ -1067,7 +1067,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::lowerBound(const Key &akey)
{
detach();
Node *lb = d->root() ? d->root()->lowerBound(akey) : 0;
Node *lb = d->root() ? d->root()->lowerBound(akey) : Q_NULLPTR;
if (!lb)
lb = d->end();
return iterator(lb);
@ -1077,7 +1077,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::const_iterator
QMap<Key, T>::upperBound(const Key &akey) const
{
Node *ub = d->root() ? d->root()->upperBound(akey) : 0;
Node *ub = d->root() ? d->root()->upperBound(akey) : Q_NULLPTR;
if (!ub)
ub = d->end();
return const_iterator(ub);
@ -1087,7 +1087,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::upperBound(const Key &akey)
{
detach();
Node *ub = d->root() ? d->root()->upperBound(akey) : 0;
Node *ub = d->root() ? d->root()->upperBound(akey) : Q_NULLPTR;
if (!ub)
ub = d->end();
return iterator(ub);

View File

@ -594,16 +594,16 @@ public:
static int localeAwareCompare(const QString& s1, const QStringRef& s2);
// ### Qt6: make inline except for the long long versions
short toShort(bool *ok=0, int base=10) const;
ushort toUShort(bool *ok=0, int base=10) const;
int toInt(bool *ok=0, int base=10) const;
uint toUInt(bool *ok=0, int base=10) const;
long toLong(bool *ok=0, int base=10) const;
ulong toULong(bool *ok=0, int base=10) const;
qlonglong toLongLong(bool *ok=0, int base=10) const;
qulonglong toULongLong(bool *ok=0, int base=10) const;
float toFloat(bool *ok=0) const;
double toDouble(bool *ok=0) const;
short toShort(bool *ok=Q_NULLPTR, int base=10) const;
ushort toUShort(bool *ok=Q_NULLPTR, int base=10) const;
int toInt(bool *ok=Q_NULLPTR, int base=10) const;
uint toUInt(bool *ok=Q_NULLPTR, int base=10) const;
long toLong(bool *ok=Q_NULLPTR, int base=10) const;
ulong toULong(bool *ok=Q_NULLPTR, int base=10) const;
qlonglong toLongLong(bool *ok=Q_NULLPTR, int base=10) const;
qulonglong toULongLong(bool *ok=Q_NULLPTR, int base=10) const;
float toFloat(bool *ok=Q_NULLPTR) const;
double toDouble(bool *ok=Q_NULLPTR) const;
QString &setNum(short, int base=10);
QString &setNum(ushort, int base=10);
@ -1350,7 +1350,7 @@ public:
typedef QString::const_reference const_reference;
// ### Qt 6: make this constructor constexpr, after the destructor is made trivial
inline QStringRef():m_string(0), m_position(0), m_size(0){}
inline QStringRef() : m_string(Q_NULLPTR), m_position(0), m_size(0) {}
inline QStringRef(const QString *string, int position, int size);
inline QStringRef(const QString *string);
@ -1434,10 +1434,10 @@ public:
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT;
QVector<uint> toUcs4() const Q_REQUIRED_RESULT;
inline void clear() { m_string = 0; m_position = m_size = 0; }
inline void clear() { m_string = Q_NULLPTR; m_position = m_size = 0; }
QString toString() const;
inline bool isEmpty() const { return m_size == 0; }
inline bool isNull() const { return m_string == 0 || m_string->isNull(); }
inline bool isNull() const { return m_string == Q_NULLPTR || m_string->isNull(); }
QStringRef appendTo(QString *string) const;
@ -1470,16 +1470,16 @@ public:
static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
QStringRef trimmed() const Q_REQUIRED_RESULT;
short toShort(bool *ok = 0, int base = 10) const;
ushort toUShort(bool *ok = 0, int base = 10) const;
int toInt(bool *ok = 0, int base = 10) const;
uint toUInt(bool *ok = 0, int base = 10) const;
long toLong(bool *ok = 0, int base = 10) const;
ulong toULong(bool *ok = 0, int base = 10) const;
qlonglong toLongLong(bool *ok = 0, int base = 10) const;
qulonglong toULongLong(bool *ok = 0, int base = 10) const;
float toFloat(bool *ok = 0) const;
double toDouble(bool *ok = 0) const;
short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
int toInt(bool *ok = Q_NULLPTR, int base = 10) const;
uint toUInt(bool *ok = Q_NULLPTR, int base = 10) const;
long toLong(bool *ok = Q_NULLPTR, int base = 10) const;
ulong toULong(bool *ok = Q_NULLPTR, int base = 10) const;
qlonglong toLongLong(bool *ok = Q_NULLPTR, int base = 10) const;
qulonglong toULongLong(bool *ok = Q_NULLPTR, int base = 10) const;
float toFloat(bool *ok = Q_NULLPTR) const;
double toDouble(bool *ok = Q_NULLPTR) const;
};
Q_DECLARE_TYPEINFO(QStringRef, Q_PRIMITIVE_TYPE);

View File

@ -68,7 +68,7 @@ public:
Q_DECLARE_FLAGS( BoundaryReasons, BoundaryReason )
QTextBoundaryFinder(BoundaryType type, const QString &string);
QTextBoundaryFinder(BoundaryType type, const QChar *chars, int length, unsigned char *buffer = 0, int bufferSize = 0);
QTextBoundaryFinder(BoundaryType type, const QChar *chars, int length, unsigned char *buffer = Q_NULLPTR, int bufferSize = 0);
inline bool isValid() const { return d; }

View File

@ -70,7 +70,7 @@ public:
CosineCurve
};
explicit QTimeLine(int duration = 1000, QObject *parent = 0);
explicit QTimeLine(int duration = 1000, QObject *parent = Q_NULLPTR);
virtual ~QTimeLine();
State state() const;