I have a class which inherits QListViewItem.
class myItem : public QListViewItem
{
public:
......
void somefunction();
}
now I create a list view "mainList" from Qt Designer and add my items in this way
myItem *item=new myItem(mainList,"label");
however when I try to fetch the item by iterating the listview why wouldn't the following code work
myItem *item=mainList->firstChild();
//this creates an error : InValid conversion from QListViewItem to myItem

but if I do
QListViewItem *item=mainList->firstChild();
then it is ok but I can't call someFunction() which is inside myItem
I know the working solution is :
myItem *item=(myItem *) mainList->firstChild();
but I am wondering if myItem inherits QListViewItem then it "is a" QListViewItem ..so why do we still need to typecast. Shouldn't the "is a " relationship of inheritence hold true here ?

Thank you to anyone who would like to solve this small query.