在QGraphicsScene上添加2个自定义的Item 的时候 然后移动这2个Item 在删除的时候 出现错误。定位到QGraphicsSceneFindItemBspTree Visitor这个函数上。

    其他的Item都是好的。在代码上也没找到错误。

    google了下 貌似不是自己的原因 是qt本身的一个BUG:

    Crash in QGraphicsSceneBspTree when adding items in response to a mouse press and adjusting them when moving.*>
*>
Resolution: Always call prepareGeometryChange() before changing the item's geometry. Otherwise, the scene's index will fall out of sync, and the behavior is undefined.*>


*>

    其实就是在移动的时候prepareGeometryChange()这个函数没好好的调用。放在正确的顺序后就没出错了。*>


*>

    原文:http://benlaux.blogspot.kr/2010/07/valgrind1.html*>