Q3 classes are not recommend to be used for new code, it's only to support old code

There are couple of ways to do this, one of the ways would be implement a class which is a sub-class of Q3CheckListItem and use that new class to add items on the view. Then implement Q3CheckListItem::stateChange() virtual method in the new class, and use the text() method to get the name an use it.

Example:
Qt Code:
  1. class myItem : public Q3CheckListItem
  2. {
  3. public:
  4. //add required constructors
  5. protected:
  6. stateChange (bool b)
  7. {
  8. QString item_name;
  9. if(b == true)
  10. {
  11. if(state() == Q3CheckListItem::On)
  12. {
  13. item_name = text();
  14. // Use item_name or whatever you want
  15. }
  16. }
  17. }
  18. };
  19.  
  20. ...
  21. for (int i = 0; i < files.size(); ++i)
  22. {
  23. fileInfo = files.at(i);
  24. item = new myItem(listView,QString(”%1”).arg(fil eInfo.fileName()),Q3CheckListItem::CheckBox );
  25. }
  26. ...
To copy to clipboard, switch view to plain text mode