Hi,
I'm using a QlistWidget with Multiselection.... is that possible to get the indexes of selected items in the List, the selectedItems() return a list of selected items but l only need the indexes ( row selected).
thanks,
Michael
Hi,
I'm using a QlistWidget with Multiselection.... is that possible to get the indexes of selected items in the List, the selectedItems() return a list of selected items but l only need the indexes ( row selected).
thanks,
Michael
Hi friend
There's 2 methods in QListWidget: selectedItems and selectedIndexes. I guess that second one can help you
hugs![]()
this method is private but googling that l found a thread: "Retrieve selected indices from a QListWidget"
the solution is:
QModelIndexList indexes = listWidget->selectionModel()->selectedIndexes();
std::vector<int> indexList;
foreach(QModelIndex index, indexes)
indexList.push_back(index.row());
thanks,
Michael
Bookmarks