问题 I have a QStandardItemModel, which I display in q QTreeView. Works fine. To highlight relevant rows I want to highlight some of them: Therefore I have a QStringList with the names of the QStandItem* s to be highlighted. QStringList namesToBeHighlighted = getNames(); QModelIndex in = myModel->index(0, 0); if ( in.isValid() ) { for (int curIndex = 0; curIndex < myModel->rowCount(in); ++curIndex) { QModelIndex si = myModel->index(curIndex, 0, in); QStandardItem *curItem = myModel->itemFromIndex