summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 57711389c4..263c4019f7 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -516,7 +516,7 @@ void QMetaCallEvent::placeMetaCall(QObject *object)
\reentrant
- QSignalBlocker can be used whereever you would otherwise use a
+ QSignalBlocker can be used wherever you would otherwise use a
pair of calls to blockSignals(). It blocks signals in its
constructor and in the destructor it resets the state to what
it was before the constructor ran.
@@ -999,7 +999,7 @@ QObject::~QObject()
if (senderLists)
senderLists->dirty = true;
- QtPrivate::QSlotObjectBase *slotObj = Q_NULLPTR;
+ QtPrivate::QSlotObjectBase *slotObj = nullptr;
if (node->isSlotObject) {
slotObj = node->slotObj;
node->isSlotObject = false;
@@ -1045,7 +1045,7 @@ QObjectPrivate::Connection::~Connection()
/*!
- \fn QMetaObject *QObject::metaObject() const
+ \fn const QMetaObject *QObject::metaObject() const
Returns a pointer to the meta-object of this object.
@@ -1093,7 +1093,9 @@ QObjectPrivate::Connection::~Connection()
\sa metaObject()
*/
-/*! \fn T *qobject_cast<T *>(QObject *object)
+/*!
+ \fn template <class T> T qobject_cast(QObject *object)
+ \fn template <class T> T qobject_cast(const QObject *object)
\relates QObject
Returns the given \a object cast to type T if the object is of type
@@ -1469,14 +1471,14 @@ void QObject::moveToThread(QThread *targetThread)
}
QThreadData *currentData = QThreadData::current();
- QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : Q_NULLPTR;
+ QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : nullptr;
if (d->threadData->thread == 0 && currentData == targetData) {
// one exception to the rule: we allow moving objects with no thread affinity to the current thread
currentData = d->threadData;
} else if (d->threadData != currentData) {
qWarning("QObject::moveToThread: Current thread (%p) is not the object's thread (%p).\n"
"Cannot move to target thread (%p)\n",
- currentData->thread.load(), d->threadData->thread.load(), targetData ? targetData->thread.load() : Q_NULLPTR);
+ currentData->thread.load(), d->threadData->thread.load(), targetData ? targetData->thread.load() : nullptr);
#ifdef Q_OS_MAC
qWarning("You might be loading two sets of Qt binaries into the same process. "
@@ -1743,7 +1745,7 @@ void QObject::killTimer(int id)
/*!
- \fn T *QObject::findChild(const QString &name, Qt::FindChildOptions options) const
+ \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.
@@ -1780,7 +1782,7 @@ void QObject::killTimer(int id)
*/
/*!
- \fn QList<T> QObject::findChildren(const QString &name, Qt::FindChildOptions options) const
+ \fn template<typename T> QList<T> QObject::findChildren(const QString &name, Qt::FindChildOptions options) const
Returns all children of this object with the given \a name that can be
cast to type T, or an empty list if there are no such objects.
@@ -1805,7 +1807,7 @@ void QObject::killTimer(int id)
*/
/*!
- \fn QList<T> QObject::findChildren(const QRegExp &regExp, Qt::FindChildOptions options) const
+ \fn template<typename T> QList<T> QObject::findChildren(const QRegExp &regExp, Qt::FindChildOptions options) const
\overload findChildren()
Returns the children of this object that can be cast to type T
@@ -1829,7 +1831,7 @@ void QObject::killTimer(int id)
*/
/*!
- \fn T qFindChild(const QObject *obj, const QString &name)
+ \fn template<typename T> T qFindChild(const QObject *obj, const QString &name)
\relates QObject
\overload qFindChildren()
\obsolete
@@ -1845,7 +1847,7 @@ void QObject::killTimer(int id)
*/
/*!
- \fn QList<T> qFindChildren(const QObject *obj, const QString &name)
+ \fn template<typename T> QList<T> qFindChildren(const QObject *obj, const QString &name)
\relates QObject
\overload qFindChildren()
\obsolete
@@ -1861,7 +1863,7 @@ void QObject::killTimer(int id)
*/
/*!
- \fn QList<T> qFindChildren(const QObject *obj, const QRegExp &regExp)
+ \fn template<typename T> QList<T> qFindChildren(const QObject *obj, const QRegExp &regExp)
\relates QObject
\overload qFindChildren()
@@ -2128,7 +2130,7 @@ void QObject::removeEventFilter(QObject *obj)
/*!
- \fn QObject::destroyed(QObject *obj)
+ \fn void QObject::destroyed(QObject *obj)
This signal is emitted immediately before the object \a obj is
destroyed, and can not be blocked.
@@ -2340,7 +2342,7 @@ static void err_info_about_objects(const char * func,
a thread different from this object's thread. Do not use this
function in this type of scenario.
- \sa senderSignalIndex(), QSignalMapper
+ \sa senderSignalIndex()
*/
QObject *QObject::sender() const
@@ -4600,7 +4602,7 @@ void qDeleteInEventHandler(QObject *o)
}
/*!
- \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
+ \fn template<typename PointerToMemberFunction> QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
\overload connect()
\threadsafe
@@ -4664,7 +4666,7 @@ void qDeleteInEventHandler(QObject *o)
*/
/*!
- \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
+ \fn template<typename PointerToMemberFunction, typename Functor> QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
\threadsafe
\overload connect()
@@ -4698,7 +4700,7 @@ void qDeleteInEventHandler(QObject *o)
*/
/*!
- \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
+ \fn template<typename PointerToMemberFunction, typename Functor> QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
\threadsafe
\overload connect()
@@ -4896,7 +4898,7 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
return true;
}
-/*! \fn bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
+/*! \fn template<typename PointerToMemberFunction> bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
\overload diconnect()
\threadsafe
@@ -5025,7 +5027,7 @@ bool QObjectPrivate::disconnect(const QObject *sender, int signal_index, void **
*/
/*!
- Create a copy of the handle to the connection
+ Create a copy of the handle to the \a other connection
*/
QMetaObject::Connection::Connection(const QMetaObject::Connection &other) : d_ptr(other.d_ptr)
{
@@ -5033,6 +5035,9 @@ QMetaObject::Connection::Connection(const QMetaObject::Connection &other) : d_pt
static_cast<QObjectPrivate::Connection *>(d_ptr)->ref();
}
+/*!
+ Assigns \a other to this connection and returns a reference to this connection.
+*/
QMetaObject::Connection& QMetaObject::Connection::operator=(const QMetaObject::Connection& other)
{
if (other.d_ptr != d_ptr) {