Itération parmi les colonnes du modèle
Gtk::TreeModel fournit un conteneur dans le style de la bibliothèque standard C++ pour ses enfants par l'intermédiaire de la fonction membre children(). Vous pouvez utiliser les fonctions membres habituelles begin() et end() pour incrémenter un itérateur, comme ceci :
auto children = refModel->children(); for (auto iter = children.begin(), end = children.end(); iter != end; ++iter) { auto row = *iter; //Do something with the row - see above for set/get. }
If you always want to iterate across the entire range, much more succinct syntax is possible using C++'s range-based for loop:
for (auto row: refModel->children()) { //Do something with the row - see above for set/get. }
- X.III.I. Ligne enfant