Qt QPainter::end: Painter ended whith 2 saced states

来源:互联网 发布:java自动包装机制 编辑:程序博客网 时间:2024/05/21 21:50

在使用Qt  QPainter 的时候,有时会遇到“QPainter::end: Painter ended whith 2 saced states”


这时由于我们在使用的QPanter.translate();函数,而在绘制结束的时候没有使用 restore()函数


出现QPainter::end: Painter ended whith 2 saced states 敬告,只需要在在绘制的结束的时候加上 restore() 函数就好了了






2 0