summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-08-26 15:49:25 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-08-26 15:49:25 (GMT)
commit2b7aaf18660fb6639a97b0421563696648384948 (patch)
treec332c0919b79f6cef5a7d79996d7e5857a110721
parent743117fa94b5e8807b0b9f9b16f2a712e6bfb47f (diff)
downloadQt-2b7aaf18660fb6639a97b0421563696648384948.zip
Qt-2b7aaf18660fb6639a97b0421563696648384948.tar.gz
Qt-2b7aaf18660fb6639a97b0421563696648384948.tar.bz2
Doc: Corrected incorrect snippets and info in inherits() documentation.
Task-number: 201882 Reviewed-by: Trust Me
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qobject.cpp6
-rw-r--r--src/corelib/kernel/qobject.cpp7
2 files changed, 6 insertions, 7 deletions
diff --git a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp
index 5c0f80c..a02d4e9 100644
--- a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp
+++ b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp
@@ -39,10 +39,10 @@ timer->inherits("QTimer"); // returns true
timer->inherits("QObject"); // returns true
timer->inherits("QAbstractButton"); // returns false
-// QLayout inherits QObject and QLayoutItem
-QLayout *layout = new QLayout;
+// QVBoxLayout inherits QObject and QLayoutItem
+QVBoxLayout *layout = new QVBoxLayout;
layout->inherits("QObject"); // returns true
-layout->inherits("QLayoutItem"); // returns false
+layout->inherits("QLayoutItem"); // returns true (even though QLayoutItem is not a QObject)
//! [4]
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index ddfc44f..1f35c73 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1089,10 +1089,9 @@ QObjectPrivate::Connection::~Connection()
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 4
- (\l QLayoutItem is not a QObject.)
-
- Consider using qobject_cast<Type *>(object) instead. The method
- is both faster and safer.
+ If you need to determine whether an object is an instance of a particular
+ class for the purpose of casting it, consider using qobject_cast<Type *>(object)
+ instead.
\sa metaObject(), qobject_cast()
*/