hi,my problem is that I have a class inherited from QGraphicsObject,and I have a private QPixmap variable car.All I want to do is draw this car image in the scene.I want to draw many cars like this.And I need to know whether two cars collides with each other.I rewrite two functions boundingRect() and shape(),but it do not work.Here is my code:
QRectF Car::boundingRect() const
{
return QRectF(QPointF(0,0),car.size());

}
QPainterPath Car::shape() const
{
QPainterPath path;
path.addRect(boundingRect());
return path;
}

Does anything go wrong?