• 6334阅读
  • 2回复

[讨论]QGraphicsScene的前景和背景画图 [复制链接]

上一主题 下一主题
离线bilong
 
只看楼主 倒序阅读 楼主  发表于: 2013-04-18
QGraphicsScene的前景和背景画图是一样的用法吗?
我用drawBackground(QPainter *, const QRectF &)可以绘图
可用drawForeground(QPainter *, const QRectF &)却哈不出来。
我想在不同的图层上绘图。
离线foxgod

只看该作者 1楼 发表于: 2018-09-19
这个函数怎么调用
离线maxlogo

只看该作者 2楼 发表于: 2018-09-19
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.
个人博客:
简书:https://www.jianshu.com/u/14fa805306bd
CSDN:https://blog.csdn.net/qq10097355
思否:https://segmentfault.com/u/lowbees/articles
快速回复
限100 字节
 
上一个 下一个