hi all,
i have filled a QListWidget with instances of my own class cMassnahme which inherits from QListWidgetItem.
Now i want to find all selected items and put their IDs (those are QStrings, i am not talking about their place within the QListWidget) into a QStringList called filterMassnahmen.
The function QListWidget::selectedItems() returns QListWidgetItems, so if i don't use it differently i won't be able to access my method getID() as this is not a method of QListWidgetItem. Therefore i tried
Qt Code:
  1. QList<cMassnahme *> items = listMassnahmen->selectedItems ();
  2. for (int i = 0; i < items.size(); ++i) {
  3. filterMassnahmen << items.at(i)->getID();
  4. }
To copy to clipboard, switch view to plain text mode 
which gives me the message:
Qt Code:
  1. error: conversion from `QList<QListWidgetItem*>' to non-scalar type `QList<cMassnahme*>' requested
To copy to clipboard, switch view to plain text mode 
how else could i solve that? even if i tried to reimplement selectedItems() i would have to access QListWidgetItem::selectedItems() in there and still get to the same problem.