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:
//Get user inputs
int names = ui->listWidget->count();
for(int i = 0; i <= names; i++){
QString list
= ui
->listWidget
->item
(i
)->text
();
}
//Get user inputs
int names = ui->listWidget->count();
for(int i = 0; i <= names; i++){
QString list = ui->listWidget->item(i)->text();
}
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.
Bookmarks