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  · 

Creating Links

These commands are for creating hyperlinks to classes, functions, examples, and other targets.

\l (link)

The \l link command is used to create a hyperlink to many different kinds of targets. The command's general syntax is:

 \l {link target} {link text}
  / *!
     Read the \l {http://qt.nokia.com/doc/4.0/}
     {Qt's Reference Documentation} carefully.
  * /
 

QDoc renders this as:

Read the Qt's Reference Documentation carefully.

If the link target is equivalent to the link text, the second argument can be omitted.

For example, if you have documentation like:

 / *!
    \target assertions

    Assertions make some statement about the text at the
    point where they occur in the regexp but they do not
    match any characters.

    ...

    Regexps are built up from expressions, quantifiers, and
    \l {assertions} {assertions}.
 * /

You can simplify this as follows:

 / *!
   \target assertions

   Assertions make some statement about the text at the
   point where they occur in the regexp but they do not
   match any characters.

   ...

   Regexps are built up from expressions, quantifiers, and
   \l assertions.
 * /

For the one-parameter version the braces can often be omitted. The \l command supports several kinds of links:

  • \l QWidget - The name of a class documented with the \class command.
  • \l QWidget::sizeHint() - The name of a member function, documented with or without an \fn command.
  • \l <QtGlobal> - The subject of a \headerfile command.
  • \l widgets/wiggly - The relative path used in an \example command.
  • \l {QWidget Class Reference} - The title used in a \title command.
  • \l {Introduction to QDoc}- The text from one of the \part, \chapter or \section commands.
  • \l fontmatching - The argument of a \target command.
  • \l {Shared Classes} - A keyword named in a \keyword command.
  • \l network.html - The file name used in a \page command.
  • \l http://qt.nokia.com/ - A URL.

QDoc also tries to make a link out of any words that don't resemble any normal English words, for example Qt class names or functions, like QWidget or QWidget::sizeHint(). In these cases, the \l command can actually be omitted, but by using the command, you ensure that QDoc will emit a warning if it cannot find the link target. In addition, if you only want the function name to appear in the link, you can use the following syntax:

  • \l {QWidget::} {sizeHint()}

QDoc renders this as:

sizeHint()

See also \sa, \target and \keyword.

\sa (see also)

The \sa command defines a list of links that will be rendered in a separate "See also" section at the bottom of the documentation unit.

The command takes a comma-separated list of links as its argument. If the line ends with a comma, you can continue the list on the next line. The general syntax is:

 \sa {the first link}, {the second link},
     {the third link}, ...

QDoc will automatically try to generate "See also" links interconnecting a property's various functions. For example, a setVisible() function will automatically get a link to visible() and vice versa.

In general, QDoc will generate "See also" links that interconnect the functions that access the same property. It recognizes four different syntax versions:

  • property()
  • setProperty()
  • isProperty()
  • hasProperty()

The \sa command supports the same kind of links as the \l command.

   / *!
      Appends the actions \a actions to this widget's
      list of actions.

      \sa removeAction(), QMenu, addAction()
   * /
   void QWidget::addActions(QList<QAction *> actions)
   {
   ...
   }
 

QDoc renders this as:

void QWidget::addActions ( QList<QAction*> actions )

Appends the actions actions to this widget's list of actions.

See also removeAction(), QMenu, and addAction().

See also \l, \target and \keyword.

\target

The \target command names a place in the documentation that you can link to using the \l (link) and \sa (see also) commands.

The text up to the line break becomes the target name. Be sure to follow the target name with a line break. Curly brackets are not required around the target name, but they may be required when the target name is used in a link cammand. See below.

 / *!
     \target capturing parentheses
     \section1 Capturing Text

     Parentheses allow us to group elements together so that
     we can quantify and capture them.

     ...
 * /

The target name capturing parentheses can be linked from within the same document containing the target in two ways:

  • \l {capturing parentheses} (from within the same qdoc comment)
  • \l qregexp.html#capturing-parentheses (from elsewhere in the same document)

Note: The brackets in the link example are required because the target name contains spaces.

From other documents, the target name can be linked this way:

  • \l http://doc.qt.nokia.com/4.0/qregexp.html#capturing-parentheses

See also \l, \sa and \keyword.

\keyword

The \keyword command names a place in the documentation that you can link to using the \l (link) and \sa (see also) commands.

The \keyword command is like the \target command, but stronger. A keyword can be linked from anywhere using a simple syntax.

Keywords must be unique over all the documents processed during the QDoc run. The command uses the rest of the line as its argument. Be sure to follow the keyword with a line break.

 / *!
     \class QRegExp
     \reentrant
     \brief The QRegExp class provides pattern
            matching using regular expressions.
     \ingroup tools
     \ingroup misc
     \ingroup shared
     \mainclass

     \keyword regular expression

     Regular expressions, or "regexps", provide a way to
     find patterns within text.

     ...
 * /

The location marked with the keyword can be linked with:

 / *!
     When a string is surrounded by slashes, it is
     interpreted as a \l {regular expression}.
 * /

QDoc renders this as:

When a string is surrounded by slashes, it's interpreted as a regular expression.

If the keyword text contains spaces, the brackets are required.

See also \l (link), \sa (see also) and \target.

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