码迷,mamicode.com
首页 > Web开发 > 详细

<qt> QGraphicsSceneFindItemBspTreeVisitor 造成的visit 出错

时间:2014-08-16 17:13:21      阅读:527      评论:0      收藏:0      [点我收藏+]

标签:qt qgraphicsscenebsptree visitor

   在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*>

<qt> QGraphicsSceneFindItemBspTreeVisitor 造成的visit 出错,布布扣,bubuko.com

<qt> QGraphicsSceneFindItemBspTreeVisitor 造成的visit 出错

标签:qt qgraphicsscenebsptree visitor

原文地址:http://cherryliuhai.blog.51cto.com/7510250/1541034

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!