From 7aca5aa910f610239c7d33696003d100e558d45a Mon Sep 17 00:00:00 2001 From: Teemu Katajisto Date: Wed, 8 Feb 2012 13:42:41 +0200 Subject: Various documentation fixes ported from 4.8 Selected documentation fixes for qtbase from 4.8 commit 40fb4750910e23d3e7128ca8e0f1c5920b05bd5a Task-number: QTBUG-8625 Task-number: QTBUG-19808 Task-number: QTBUG-1231 Task-number: QTBUG-21073 Task-number: QTBUG-8939 Task-number: QTBUG-20399 Task-number: QTBUG-20944 Task-number: QTBUG-22095 Task-number: QTBUG-11278 Task-number: QTBUG-15653 Change-Id: Ia4f59fce7c85f04b6da953a3988f705d9d9a658a Reviewed-by: Casper van Donderen --- src/corelib/kernel/qmetaobject.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qmetaobject.cpp') diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 7975fc2628..5ffa2d81dd 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1353,7 +1353,30 @@ const char *QMetaMethod::typeName() const Returns the tag associated with this method. Tags are special macros recognized by \c moc that make it - possible to add extra information about a method. For the moment, + possible to add extra information about a method. + + Tag information can be added in the following + way in the function declaration: + + \code + #define THISISTESTTAG // tag text + ... + private slots: + THISISTESTTAG void testFunc(); + \endcode + + and the information can be accessed by using: + + \code + MainWindow win; + win.show(); + + int functionIndex = win.metaObject()->indexOfSlot("testFunc()"); + QMetaMethod mm = metaObject()->method(functionIndex); + qDebug() << mm.tag(); // prints THISISTESTTAG + \endcode + + For the moment, \c moc doesn't support any special tags. */ const char *QMetaMethod::tag() const -- cgit v1.2.3