Reputation: 79537
If I have this code:
foreach (QListWidgetItem *ii, selectedItems()) {
urls.push_back(ii->data(Qt::ToolTip).toString());
}
Would selectedItems()
be called only once?
Upvotes: 3
Views: 2016
Reputation: 25690
Yup. It will create a copy of the returned container, and use that. (See Qt foreach keyword documentation)
Related:
Upvotes: 3