0

I create my own class:

class myTile : public QGraphicsItem{}

I add these myTile in a QGraphicsScene. Every myTile has a value and a getter for the value. Now I want to get a myTile and read its value.

I tried collidingItems() and itemAt(), but the problem is: These two method can only return QGraphicsItem. The QGraphicsItem doesn't have my return value method in myTile. Is there a way to get a custom item?
Thank you in advance!

Angie Quijano
  • 4,167
  • 3
  • 25
  • 30
lancellx
  • 285
  • 1
  • 5
  • 15

1 Answers1

0
myTile *t = (myTile*)myScene->itemAt(i);
t->myMethod();
Dmitry Melnikov
  • 743
  • 4
  • 13