I have a list of inputs from a csv document in a QListWidget, and I want to associate each item with an ID, so when I double click the specific item I can configure it. I tried with this "QListWidgetItem *item = rowData;", but it gave me an error. Code in the constructor:
if (getin.open(QFile::ReadOnly)) {
//Collect all data from the file
items = getin.readAll();
//Split all data line by line
rowOfData = items.split("\n");
//Close csv document
getin.close();
} //Go through the data collected, and split them by two delimiters.
for (int x = 0; x < rowOfData.size(); x++)
{
rowData = rowOfData.at(x).split(",").first().split(":");
if(!rowData.isEmpty())
ui->itemListWidget->addItem(rowData.first());
QListWidgetItem *item = rowData;
}
The function for when an item is double-clicked:
void storage::on_itemListWidget_itemDoubleClicked(QListWidgetItem *item)
{
itemwindow = new itemWindow(this);
itemwindow->show();
}
QListWidgetItem *item = rowData;? - thuga