IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

<QForeach>

Qt Core Reference Documentation.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Macro Documentation▲

 

Q_FOREACH(variable, container)▲

Same as foreach(variable, container).

This macro is available even when no_keywords is specified using the .pro file's CONFIG variable.

Since Qt 5.7, the use of this macro is discouraged. It will be removed in a future version of Qt. Please use C++11 range-for, possibly with qAsConst(), as needed.

See Also▲

See also qAsConst()

Q_FOREVER▲

Same as https://.

This macro is available even when no_keywords is specified using the .pro file's CONFIG variable.

See Also▲

See also https://()

foreach(variable, container)▲

This macro is used to implement Qt's foreach loop. The variable parameter is a variable name or variable definition; the container parameter is a Qt container whose value type corresponds to the type of the variable. See https:// for details.

If you're worried about namespace pollution, you can disable this macro by adding the following line to your .pro file:

 
Sélectionnez
CONFIG += no_keywords

Since Qt 5.7, the use of this macro is discouraged. It will be removed in a future version of Qt. Please use C++11 range-for, possibly with qAsConst(), as needed.

See Also▲

See also qAsConst()

forever▲

This macro is provided for convenience for writing infinite loops.

Example:

 
Sélectionnez
forever {
    ...
}

It is equivalent to for (;;).

If you're worried about namespace pollution, you can disable this macro by adding the following line to your .pro file:

 
Sélectionnez
CONFIG += no_keywords

See Also▲

See also https://

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.