QGraphicsItem::boundingRect ()
是一个虚函数,所以我重写了它来处理我自己的一些东西,
然后我发现它被重复调用,但我从未从我自己的代码中显式调用它。
谁在召唤它?表演或绘画之类的东西?
最佳答案
来自关于 QGraphicsItem::boundingRect
的 Qt 文档:
Reimplement this function to let QGraphicsView determine what parts of the widget, if any, need to be redrawn.
实际上是被QGraphicsView
用来判断item是否需要重绘。因此它可能会被 View 多次调用。
关于c++ - QGraphicsItem::boundingRect () 被重复调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27430237/