What is the best way to do that please ?
If you only want to browse your model and apply a regular expression, you can use QAbstractItemModel::rowCount() and QAbstractItemModel::columnCount() and two loops to get each item in your model with QAbstractItemModel::item():
for ( int col = 0; col < model.columnCount(); ++col )
{
for( int row = 0; row < model.rowCount(); ++row )
{
item = model.item( row, col );
doSomething( item->text() );
}
}
If you want to filter your model to display only the items that match your regexp, you should use a QSortFilterModel.
Edit for small syntaxic typo and indent.