PDA

View Full Version : Do a special cast with qobject_cast



crazy_inf
3rd April 2010, 12:32
Hi there.
Can we cast a QList<T> with qobject_cast?

toutarrive
3rd April 2010, 12:46
To do what?

crazy_inf
3rd April 2010, 12:55
Actually, I'm trying to use collidingItems fonction and it returns a list of QGraphicsItem* , in another hand I've defined a class named Trame, which Inherits from QObject and QGraphicsItem.
Now, I want to get all colliding objects of type Trame with an other object of the same type?

axeljaeger
3rd April 2010, 16:07
1) Use qgraphicsitem_cast
2) You will have to iterate over the list.