首页| 论坛| 消息

标题:QGraphicsScene的前景和背景画图
作者:bilong
日期:2013-04-18 21:49
内容:

QGraphicsScene的前景和背景画图是一样的用法吗?
我用drawBackground(QPainter *, const QRectF &)可以绘图,
可用drawForeground(QPainter *, const QRectF &)却哈不出来。
我想在不同的图层上绘图。


#1 [foxgod 09-19 14:47]
这个函数怎么调用
#2 [maxlogo 09-19 14:54]
Draws the foreground of the scene using painter, after the background and all items have been drawn. Reimplement this function to provide a custom foreground for the scene.
All painting is done in scene coordinates. The rect parameter is the exposed rectangle.
If all you want is to define a color, texture or gradient for the foreground, you can call setForegroundBrush() instead.

回复 发表
主题 版块