Is there a similar procedure in c++ to the java "instanceof"??

I would like to tell apart from the QObject::childs() list which widgets subclass a common base class i created for my subclassed widgets, but I haven't succeeded yet, the code I'm using right now is :

Qt Code:
  1. void fetchChildData(QObject* vent){
  2. QObjectList childs = vent->children();
  3. for(int i = 0 ; i < childs.size() ; i++){
  4. displayWidget* dW = dynamic_cast<displayWidget*>(childs[i]);
  5. if(dW!=0){
  6. dW->fetchData();
  7. }
  8. fetchChildData(childs[i]);
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

But it won't make the trick,... Any help would be really appreciated.