Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Relating Things

The relating commands are for specifying how one documented element relates to another documented element. e.g., This function is an overload of another function, or this function is a reimplementation of another function, or this typedef is related to some class or header file. There is also a command for documenting that a QML type inherits some other QML type.

Commands

\inherits

The \inherits command is for documenting that one QML type inherits some other QML type. It must be included in the inheriting element's \qmlclass comment. The argument is the name of the inherited QML type.

 / *!
     \qmlclass PauseAnimation QDeclarativePauseAnimation
     \ingroup qml-animation-transition
     \since 4.7
     \inherits Animation
     \brief The PauseAnimation element provides a pause for an animation.

     When used in a SequentialAnimation, PauseAnimation is a step
     when nothing happens, for a specified duration.

     A 500ms animation sequence, with a 100ms pause between two animations:

     SequentialAnimation {
         NumberAnimation { ... duration: 200 }
         PauseAnimation { duration: 100 }
         NumberAnimation { ... duration: 200 }
     }

     \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
 * /

QDoc includes this line on the reference page for the PauseAnimation element:

Inherits Animation

\overload

The \overload command is for indicating that a function is a secondary overload of its name.

The command must stand on its own line.

For a function name that is overloaded (except constructors), QDoc expects one primary version of the function, and all the others marked with the \overload command. The primary version should be fully documented. Each overload can have whatever extra documentation you want to add for just that overloaded version.

From Qt 4.5, you can include the function name plus '()' as a parameter to the \overload command, which will include a standard This function overloads... line of text with a link to the documentation for the primary version of the function.

 / *!
     \overload addAction()

     This convenience function creates a new action with an
     \a icon and some \a text. The function adds the newly
     created action to the menu's list of actions, and
     returns it.

     \sa QWidget::addAction()
 * /
 QAction *QMenu::addAction(const QIcon &icon, const QString &text)
 {
     QAction *ret = new QAction(icon, text, this);
     addAction(ret);
     return ret;
 }
 

QDoc renders this as:

QAction * QMenu::addAction ( const QIcon & icon, const QString & text )

This function overloads addAction()

This convenience function creates a new action with an icon and some text. The function adds the newly created action to the menu's list of actions, and returns it.

See also QWidget::addAction().

If you don't include the function name with the \overlaod command, then instead of the "This function overloads..." line with the link to the documentation for the primary version, you get the old standard line:

This is an overloaded member function, provided for convenience.

.

\reimp

The \reimp command is for indicating that a function is a reimplementation of a virtual function.

The command must stand on its own line.

QDoc will omit the reimplemented function from the class reference.

 / *!
     \reimp
 * /
 void QToolButton::nextCheckState()
 {
     Q_D(QToolButton);
     if (!d->defaultAction)
         QAbstractButton::nextCheckState();
     else
         d->defaultAction->trigger();
 }

This function will not be included in the documentation. Instead, a link to the base function QAbstractButton::nextCheckState() will appear in the documentation.

\relates

The \relates command is for including the documentation of a global element to some class or header file. The argument is a class name or header file.

 / *!
     \relates QChar

     Reads a char from the stream \a in into char \a chr.

     \sa {Format of the QDataStream operators}
 * /
 QDataStream &operator>>(QDataStream &in, QChar &chr)
 {
     quint16 u;
     in >> u;
     chr.unicode() = ushort(u);
     return in;
 }

The documentation for this function will be included on the reference page for class QChra.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web