QListWidget::selectedItems returns a list of QListWidgetItem, but the only function for removing an item that I found is takeItem, which accepts only indexes, and selectedIndexes function is protected.
In CSharp its as simple as writting :
listBox1.Items.Add("Hello");
listBox1.Items.Add("There");
foreach (string item in listBox1.Items )
{
MessageBox.Show(item.ToString());
}
and I can easily add different objects to a list box and then retrieve them …
How to remove selected items from qlistWidget.
I have tried write the following code, but does not work.
QList<QListWidgetItem*> items = ui->listWidget->selectedItems();
foreach(QListWidgetItem item, items){
ui->listWidget->removeItemWidget(item);
}
Now, how …
I want to store some filenames in a QListWidget. I need to have the full file paths, but I only want to show the base filename. I probably could store the full filename in the tooltip for each item, but …