Hi,

I have a base class called CItem and 3 derived class called respectively CItemSound, CItemImage and CItemColor.

My application uses a QValueList<CItem>objList member to manipulate all my objets (of type CItemSound, CItemImage and CItemColor) regardless to their type.

I declare the objList member as follow :
Qt Code:
  1. QValueList<CItem>objList;
To copy to clipboard, switch view to plain text mode 
and I fill it as follow :
Qt Code:
  1. CItemSound s1;
  2. s1.setItemName("Sound 1 of list 1");
  3. CItemImage i1;
  4. i1.setItemName("Image 1 of list 1");
  5. CItemColor c1;
  6. c1.setItemName("Color 1 of list 1");
  7. list1.append(s1);
  8. list1.append(i1);
  9. list1.append(c1);
To copy to clipboard, switch view to plain text mode 

Let me explain my problem now :
in a function I need to do something like this :
Qt Code:
  1. CItemSound s = objList[0];
To copy to clipboard, switch view to plain text mode 
... it fails ... how is it possible to do such a cast ?

Thanks in advance