我正在开展一个项目,我使用QGraphicsScene
,QGraphicsViwe
,QGraphicsItem
。我想在调用QGraphicsItem::paint
之前做一些计算。
那么在调用QGraphicsItem::paint
之前有办法做某事吗?
提前谢谢!
答案 0 :(得分:1)
QGraphicsView
有函数showEvent()
,如果你覆盖它,你将在item的paint函数之前调用它。您可以通过调用scene()
功能获取您的场景,之后您可以获得所有项目。