diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2014-08-31 21:42:48 +1000 |
---|---|---|
committer | Sze Howe Koh <szehowe.koh@gmail.com> | 2014-09-25 16:50:41 +0200 |
commit | f5d58c04421fccefba86a9f6ed2339ec685f897e (patch) | |
tree | e6a8a109e061d7507c9020ea3d4fa176c8ff4ed4 /src/corelib/doc/snippets | |
parent | 4c08e3dfd5b3d985ae81bae22fee537fbf5d30db (diff) |
Doc: Remove irrelevant sections from "Signals & Slots"
- This article is not the right place to describe the low-level
mechanisms of moc and qmake, or to discuss QMetaObject features that
are unrelated to signals and slots.
- Most users never need to run moc directly.
- The current content only mentions qmake for moc automation, but CMake,
QBS, and the Visual Studio Add-In can also do that.
In light of the above 3 points, let's simply link to the "Meta-Object
System" article for those who are interested in the behind-the-scenes
details.
Most of the content deleted by this patch are already discussed in
detail in the articles "The Meta-Object System" and "Using the Meta-
Object Compiler (moc)" (the former links to the latter). The exception
is Snippet 5 -- this is deleted without replacement because
qobject_cast() is a much safer alternative to QMetaObject::inherits()
with static_cast(), so we should encourage the former.
Change-Id: I638c888cedfcdfb818747edeb806213ebd54dfb6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/doc/snippets')
-rw-r--r-- | src/corelib/doc/snippets/signalsandslots/signalsandslots.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/corelib/doc/snippets/signalsandslots/signalsandslots.cpp b/src/corelib/doc/snippets/signalsandslots/signalsandslots.cpp index 91cd3de9d2..357269bac0 100644 --- a/src/corelib/doc/snippets/signalsandslots/signalsandslots.cpp +++ b/src/corelib/doc/snippets/signalsandslots/signalsandslots.cpp @@ -38,8 +38,6 @@ ** ****************************************************************************/ -#include <QAbstractButton> - #include "signalsandslots.h" //! [0] @@ -66,19 +64,4 @@ int main() //! [3] //! [4] b.setValue(48); // a.value() == 12, b.value() == 48 //! [4] - - - QWidget *widget = reinterpret_cast<QWidget *>(new QObject(0)); -//! [5] - if (widget->inherits("QAbstractButton")) { - QAbstractButton *button = static_cast<QAbstractButton *>(widget); - button->toggle(); -//! [5] //! [6] - } -//! [6] - -//! [7] - if (QAbstractButton *button = qobject_cast<QAbstractButton *>(widget)) - button->toggle(); -//! [7] } |