Hello,

I have a QListWidget list that I first fill with QStrings, then sort the list, and then I want to get the QStrings back out of the list. I don't know how to do that. Can you help? Below is my code with comments.

Qt Code:
  1. //"number" and "features" are int values
  2. //"dataTable" is a table of integers
  3.  
  4. //declare QListWidget list
  5. QListWidget sList = new QListWidget(this);
  6.  
  7. //fill QListWidget list with entries
  8. for(int k=0; k<number+1; k++)
  9. {
  10. QString entry;
  11. for(int i=0; i<features+1; i++)
  12. {
  13. entry.append(dataTable[i][k]);
  14. entry.append(",");
  15. }
  16. sList->insertItem(k, entry);
  17. }
  18.  
  19. //sort list entries in ascending order
  20. sList->sortItems(Qt::AscendingOrder);
  21.  
  22. //get the list entries back in the QString format
  23. //I DON'T KNOW HOW??
  24. //QString entry2 = sList.itemAt(1); for example won't work
To copy to clipboard, switch view to plain text mode 

Thanks!