Hi everybody, I'm using Qt 5.4 and it seems prepareGeometryChange doesn't work correctly!!

I create a RouteItem inherit from qgraphicsobject include some lines and some nodes ( Node is another qgraphicsitems with fixed boundingrect ). when I move my nodes or change scale of my scene the RouteItem's shape changed and I call the prepareGeometryChange function of qgraphicsitem.

Everything looks OK I can select my item or right click on it, but strange problem happened when I want to delete one RouteItem, program crashed on the QGraphicsSceneFindItemBsbTreeVisitor::visit ??

this is my deletion code
Qt Code:
  1. void RouteItem::deleteRoute()
  2. {
  3. prepareGeometryChange(); // add if I forgot to call it before
  4. m_parentScene->update(); // add this line for taking effect of prepareGeometryChange and recalculate items boundry
  5. m_parentScene->removeItem(this);
  6. deleteLater();
  7. }
  8.  
  9. RoteItem::~RouteItem()
  10. {
  11. foreach(Waypoint* nd, nodeList) {
  12. m_parentScene->removeItem(nd);
  13. nd->deleteLater();
  14. }
  15. }
  16.  
  17. QPainterPath shape() const
  18. {
  19. QPainterPathStrocker strocker;
  20. // read all nodes calculate some geographical equations and create a path from items positions
  21. return strocker.createStroke(path);
  22. }
  23.  
  24. QRectF boundingRect() const
  25. {
  26. if(nodeList.count())
  27. return shape().boundingRect();
  28. return QRectF();
  29. }
To copy to clipboard, switch view to plain text mode 

thanks in advance.