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>
This commit is contained in:
parent
e3621dd6bd
commit
6298850293
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -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()
|
||||
*/
|
||||
|
@ -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().
|
||||
|
||||
|
@ -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()
|
||||
*/
|
||||
|
@ -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.
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
*/
|
||||
|
@ -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()
|
||||
*/
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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().
|
||||
|
Loading…
Reference in New Issue
Block a user