diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-27 17:49:57 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-28 19:37:22 +0000 |
commit | 6298850293f5674f43fc0ef28363bb97a4f8ea5f (patch) | |
tree | 512e53709a9d97b60b4eff4f7dbcef987183d516 | |
parent | e3621dd6bd32a64e602ae87711c24d6aae2989b5 (diff) | |
download | qtbase-6298850293f5674f43fc0ef28363bb97a4f8ea5f.tar.gz |
QtCore: replace 0 with \nullptr in documentation
Replace 0 with \nullptr in the documentation.
As a drive-by also replace some 0 with nullptr in the corresponding
code.
Change-Id: I101a61f5fad71cadb73bba9a8fd5dce6cc0836d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | src/corelib/doc/src/objectmodel/metaobjects.qdoc | 2 | ||||
-rw-r--r-- | src/corelib/io/qfiledevice.cpp | 6 | ||||
-rw-r--r-- | src/corelib/io/qresource.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 12 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 2 | ||||
-rw-r--r-- | src/corelib/serialization/qdatastream.cpp | 4 | ||||
-rw-r--r-- | src/corelib/serialization/qtextstream.cpp | 6 | ||||
-rw-r--r-- | src/corelib/serialization/qxmlstream.cpp | 8 | ||||
-rw-r--r-- | src/corelib/statemachine/qabstractstate.cpp | 7 | ||||
-rw-r--r-- | src/corelib/statemachine/qabstracttransition.cpp | 14 | ||||
-rw-r--r-- | src/corelib/statemachine/qstate.cpp | 3 | ||||
-rw-r--r-- | src/corelib/tools/qcache.qdoc | 6 |
13 files changed, 39 insertions, 37 deletions
diff --git a/src/corelib/doc/src/objectmodel/metaobjects.qdoc b/src/corelib/doc/src/objectmodel/metaobjects.qdoc index 5b3d8f9863..53b34fe120 100644 --- a/src/corelib/doc/src/objectmodel/metaobjects.qdoc +++ b/src/corelib/doc/src/objectmodel/metaobjects.qdoc @@ -86,7 +86,7 @@ that it doesn't require RTTI support and it works across dynamic library boundaries. It attempts to cast its argument to the pointer type specified in angle-brackets, returning a non-zero pointer if the - object is of the correct type (determined at run-time), or 0 + object is of the correct type (determined at run-time), or \nullptr if the object's type is incompatible. For example, let's assume \c MyWidget inherits from QWidget and diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp index 2f99775c65..0689118f3e 100644 --- a/src/corelib/io/qfiledevice.cpp +++ b/src/corelib/io/qfiledevice.cpp @@ -700,7 +700,7 @@ bool QFileDevice::setPermissions(Permissions permissions) Any mapping options can be passed through \a flags. - Returns a pointer to the memory or 0 if there is an error. + Returns a pointer to the memory or \nullptr if there is an error. \sa unmap() */ @@ -711,11 +711,11 @@ uchar *QFileDevice::map(qint64 offset, qint64 size, MemoryMapFlags flags) && d->fileEngine->supportsExtension(QAbstractFileEngine::MapExtension)) { unsetError(); uchar *address = d->fileEngine->map(offset, size, flags); - if (address == 0) + if (address == nullptr) d->setError(d->fileEngine->error(), d->fileEngine->errorString()); return address; } - return 0; + return nullptr; } /*! diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index e541b0ee20..1077e31797 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -608,7 +608,7 @@ qint64 QResource::size() const Returns direct access to a read only segment of data that this resource represents. If the resource is compressed the data returns is compressed and qUncompress() must be used to access the data. If the - resource is a directory 0 is returned. + resource is a directory \nullptr is returned. \sa size(), isCompressed(), isFile() */ diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 27153e0c4d..8082b7fe9b 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -216,8 +216,8 @@ private: Constructs a new instance of this class. You can pass up to ten arguments (\a val0, \a val1, \a val2, \a val3, \a val4, \a val5, \a val6, \a val7, - \a val8, and \a val9) to the constructor. Returns the new object, or 0 if - no suitable constructor is available. + \a val8, and \a val9) to the constructor. Returns the new object, or + \nullptr if no suitable constructor is available. Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system. @@ -321,8 +321,8 @@ const char *QMetaObject::className() const /*! \fn QMetaObject *QMetaObject::superClass() const - Returns the meta-object of the superclass, or 0 if there is no - such object. + Returns the meta-object of the superclass, or \nullptr if there is + no such object. \sa className() */ @@ -2615,7 +2615,7 @@ int QMetaEnum::keyCount() const } /*! - Returns the key with the given \a index, or 0 if no such key exists. + Returns the key with the given \a index, or \nullptr if no such key exists. \sa keyCount(), value(), valueToKey() */ @@ -2737,7 +2737,7 @@ int QMetaEnum::keyToValue(const char *key, bool *ok) const /*! Returns the string that is used as the name of the given - enumeration \a value, or 0 if \a value is not defined. + enumeration \a value, or \nullptr if \a value is not defined. For flag types, use valueToKeys(). diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index b9e35e28e4..a1d53be197 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -421,8 +421,8 @@ struct DefinedTypesFilter { pointer of this type. (given by QVariant::data for example) If the type is an enumeration, flags() contains QMetaType::IsEnumeration, and this function - returns the QMetaObject of the enclosing object if the enum was registered as a Q_ENUM or 0 - otherwise + returns the QMetaObject of the enclosing object if the enum was registered as a Q_ENUM or + \nullptr otherwise \sa QMetaType::metaObjectForType(), QMetaType::flags() */ diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 73b8c33efe..c0c009f254 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1763,7 +1763,7 @@ void QObject::killTimer(int id) \fn template<typename T> T *QObject::findChild(const QString &name, Qt::FindChildOptions options) const Returns the child of this object that can be cast into type T and - that is called \a name, or 0 if there is no such object. + that is called \a name, or \nullptr if there is no such object. Omitting the \a name argument causes all object names to be matched. The search is performed recursively, unless \a options specifies the option FindDirectChildrenOnly. diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp index cc4efc9be3..ead6ed5083 100644 --- a/src/corelib/serialization/qdatastream.cpp +++ b/src/corelib/serialization/qdatastream.cpp @@ -368,7 +368,7 @@ QDataStream::~QDataStream() /*! \fn QIODevice *QDataStream::device() const - Returns the I/O device currently set, or 0 if no + Returns the I/O device currently set, or \nullptr if no device is currently set. \sa setDevice() @@ -377,7 +377,7 @@ QDataStream::~QDataStream() /*! void QDataStream::setDevice(QIODevice *d) - Sets the I/O device to \a d, which can be 0 + Sets the I/O device to \a d, which can be \nullptr to unset to current I/O device. \sa device() diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index fb7b677b2d..c9ba183a50 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -1332,7 +1332,7 @@ void QTextStream::setDevice(QIODevice *device) /*! Returns the current device associated with the QTextStream, - or 0 if no device has been assigned. + or \nullptr if no device has been assigned. \sa setDevice(), string() */ @@ -1369,8 +1369,8 @@ void QTextStream::setString(QString *string, QIODevice::OpenMode openMode) } /*! - Returns the current string assigned to the QTextStream, or 0 if no - string has been assigned. + Returns the current string assigned to the QTextStream, or + \nullptr if no string has been assigned. \sa setString(), device() */ diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 827996ee2d..0170be7602 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -223,7 +223,7 @@ QString QXmlStreamReaderPrivate::resolveUndeclaredEntity(const QString &name) The stream reader does \e not take ownership of the resolver. It's the callers responsibility to ensure that the resolver is valid during the entire life-time of the stream reader object, or until - another resolver or 0 is set. + another resolver or \nullptr is set. \sa entityResolver() */ @@ -236,7 +236,7 @@ void QXmlStreamReader::setEntityResolver(QXmlStreamEntityResolver *resolver) /*! \since 4.4 - Returns the entity resolver, or 0 if there is no entity resolver. + Returns the entity resolver, or \nullptr if there is no entity resolver. \sa setEntityResolver() */ @@ -480,7 +480,7 @@ void QXmlStreamReader::setDevice(QIODevice *device) /*! Returns the current device associated with the QXmlStreamReader, - or 0 if no device has been assigned. + or \nullptr if no device has been assigned. \sa setDevice() */ @@ -3315,7 +3315,7 @@ void QXmlStreamWriter::setDevice(QIODevice *device) /*! Returns the current device associated with the QXmlStreamWriter, - or 0 if no device has been assigned. + or \nullptr if no device has been assigned. \sa setDevice() */ diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp index 1a9ad4601d..0db44bc427 100644 --- a/src/corelib/statemachine/qabstractstate.cpp +++ b/src/corelib/statemachine/qabstractstate.cpp @@ -155,7 +155,8 @@ QAbstractState::~QAbstractState() } /*! - Returns this state's parent state, or 0 if the state has no parent state. + Returns this state's parent state, or \nullptr if the state has no + parent state. */ QState *QAbstractState::parentState() const { @@ -166,8 +167,8 @@ QState *QAbstractState::parentState() const } /*! - Returns the state machine that this state is part of, or 0 if the state is - not part of a state machine. + Returns the state machine that this state is part of, or \nullptr if + the state is not part of a state machine. */ QStateMachine *QAbstractState::machine() const { diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp index ebf33e120a..d841fd3c8b 100644 --- a/src/corelib/statemachine/qabstracttransition.cpp +++ b/src/corelib/statemachine/qabstracttransition.cpp @@ -195,8 +195,8 @@ QAbstractTransition::~QAbstractTransition() } /*! - Returns the source state of this transition, or 0 if this transition has no - source state. + Returns the source state of this transition, or \nullptr if this + transition has no source state. */ QState *QAbstractTransition::sourceState() const { @@ -205,14 +205,14 @@ QState *QAbstractTransition::sourceState() const } /*! - Returns the target state of this transition, or 0 if the transition has no - target. + Returns the target state of this transition, or \nullptr if the + transition has no target. */ QAbstractState *QAbstractTransition::targetState() const { Q_D(const QAbstractTransition); if (d->targetStates.isEmpty()) - return 0; + return nullptr; return d->targetStates.first().data(); } @@ -325,8 +325,8 @@ void QAbstractTransition::setTransitionType(TransitionType type) } /*! - Returns the state machine that this transition is part of, or 0 if the - transition is not part of a state machine. + Returns the state machine that this transition is part of, or + \nullptr if the transition is not part of a state machine. */ QStateMachine *QAbstractTransition::machine() const { diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index 2531874a87..ae13d4e4cf 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -473,7 +473,8 @@ void QState::onExit(QEvent *event) } /*! - Returns this state's initial state, or 0 if the state has no initial state. + Returns this state's initial state, or \nullptr if the state has no + initial state. */ QAbstractState *QState::initialState() const { diff --git a/src/corelib/tools/qcache.qdoc b/src/corelib/tools/qcache.qdoc index 31dfcb42cf..ffc21318f4 100644 --- a/src/corelib/tools/qcache.qdoc +++ b/src/corelib/tools/qcache.qdoc @@ -70,7 +70,7 @@ To look up objects in the cache, use object() or operator[](). This function looks up an object by its key, and returns either a pointer to the cached object (which is owned by - the cache) or 0. + the cache) or \nullptr. If you want to remove an object from the cache for a particular key, call remove(). This will also delete the object. If you want to @@ -171,7 +171,7 @@ /*! \fn template <class Key, class T> T *QCache<Key, T>::object(const Key &key) const - Returns the object associated with key \a key, or 0 if the key does + Returns the object associated with key \a key, or \nullptr if the key does not exist in the cache. \warning The returned object is owned by QCache and may be @@ -190,7 +190,7 @@ /*! \fn template <class Key, class T> T *QCache<Key, T>::operator[](const Key &key) const - Returns the object associated with key \a key, or 0 if the key does + Returns the object associated with key \a key, or \nullptr if the key does not exist in the cache. This is the same as object(). |