From 119487650e28073f5766cc43cb679eb629a2a0c5 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 15 Jan 2019 15:32:44 +0100 Subject: Doc: End sentence about Q_GADGET with dot Change-Id: I55380d133017670f212df331fba655e80538e412 Reviewed-by: Leena Miettinen --- src/corelib/kernel/qobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel/qobject.cpp') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index b5d97c5538b..4680742a3e8 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4446,7 +4446,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) macro, it must appear in the private section of a class definition. Q_GADGETs can have Q_ENUM, Q_PROPERTY and Q_INVOKABLE, but they cannot have - signals or slots + signals or slots. Q_GADGET makes a class member, \c{staticMetaObject}, available. \c{staticMetaObject} is of type QMetaObject and provides access to the -- cgit v1.2.3 From 4faf011c3f5f4a739f4ddc54040b5319f7fe5d90 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 10 Jan 2019 17:38:55 +0100 Subject: Document that you shouldn't Q_ENUM() things outside the int range The meta object system stores enums as signed int, probably for performance reasons. This is good enough for about 99% of the use cases. If you try to register larger types and then access them through the metaobject system, you can get undefined behavior. Task-number: QTBUG-71947 Change-Id: I16b395547c22fad10b476c2c2a0768538db0a20e Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/corelib/kernel/qobject.cpp') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 4680742a3e8..42c39f18e35 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4338,6 +4338,12 @@ QDebug operator<<(QDebug dbg, const QObject *o) in a QVariant, you can convert them to strings. Likewise, passing them to QDebug will print out their names. + Mind that the enum values are stored as signed \c int in the meta object system. + Registering enumerations with values outside the range of values valid for \c int + will lead to overflows and potentially undefined behavior when accessing them through + the meta object system. QML, for example, does access registered enumerations through + the meta object system. + \sa {Qt's Property System} */ @@ -4389,6 +4395,12 @@ QDebug operator<<(QDebug dbg, const QObject *o) used in a QVariant, you can convert them to strings. Likewise, passing them to QDebug will print out their names. + Mind that the enum values are stored as signed \c int in the meta object system. + Registering enumerations with values outside the range of values valid for \c int + will lead to overflows and potentially undefined behavior when accessing them through + the meta object system. QML, for example, does access registered enumerations through + the meta object system. + \sa {Qt's Property System} */ -- cgit v1.2.3 From 6298850293f5674f43fc0ef28363bb97a4f8ea5f Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 27 Jan 2019 17:49:57 +0100 Subject: 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 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Wicking --- src/corelib/kernel/qobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel/qobject.cpp') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 73b8c33efeb..c0c009f2541 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1763,7 +1763,7 @@ void QObject::killTimer(int id) \fn template 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. -- cgit v1.2.3