Hi, i'm working on a program where i ask a user to input certain line edits that are added as a QlistWidget item when the user clicks add. I want to able to get the QlistWidget items(line edits) and save them as a string. I see no direct way of doing this in the qlistwidget library. So far I'm passing the items to a string but not able to get them each individually.

Here's the snippet of my program where I try to do this:

Qt Code:
  1. //Get user inputs
  2. int names = ui->listWidget->count();
  3. for(int i = 0; i <= names; i++){
  4. QString list = ui->listWidget->item(i)->text();
  5. }
To copy to clipboard, switch view to plain text mode 

Does anyone have an illustration or example doing something similar or the same thing?

Thanks in advance.