hello eveyone

I'm making a time trial platformer game in qt5.
I'm trying to detect collosions between the instances of the Background class but it's not working.
[through qDebug(), I found out that it's not even entering the for loop.]

Background class is a subclass of the QGraphicsPixmapItem.
all of the platforms that the player jumps on, are instances of the Background class.

myscene is an instance of the Myscene class which is a subclass of the QGraphicsScene.
m_player is an instance of the Player class which is a subclass of the QGraphicsPixmapItem.

checkcollosion() is called every time scene gets updated.

Qt Code:
  1. void Myscene::checkcollosion()
  2. {
  3. QList<QGraphicsItem*> items = collidingItems(m_player);
  4.  
  5. for (int i=0, number = items.count(); i<number; ++i)
  6. {
  7. if (Background *back = qgraphicsitem_cast<Background*>(items.at(i)))
  8. {
  9. }
  10. }
  11. }
To copy to clipboard, switch view to plain text mode 

I guess because Background is a subclass of QGraphicsPixmapItem, the collidingItems() doesn't work for it.
and can qgraphicsitem_cast be used for casting QGraphicPixmapItem or is it only for QGraphicsItem ?

so how can I fix this?