【问题标题】:Redefine QPainter options when redrawing QGraphicsItem重绘 QGraphicsItem 时重新定义 QPainter 选项
【发布时间】:2012-02-06 13:54:49
【问题描述】:

我想在 QGraphics 场景中绘制每个 QGraphicsItem 之前重新定义 QPainter。

void GraphicsScene::drawItems( QPainter * painter, int nbItem, QGraphicsItem *[] items, const QStyleOptionGraphicsItem[] options, QWidget * widget = NULL )

现在已经过时了,“新”方法是什么?

谢谢

【问题讨论】:

    标签: qt qgraphicsitem qgraphicsscene


    【解决方案1】:

    QGraphicsScene 不负责绘制者……它负责项目的存储和检索。 QGraphicsView 负责视图的绘制和变换。

    如果您想设置渲染提示来修改 QPainter 行为,您可以使用 QGraphicsView::setRenderHint 从视图中执行此操作。

    如果您只想对另一个特殊的 QPainter 引擎进行单次渲染,文档会向打印机 here 显示一个示例。

    这是QGraphicsView 上文档的链接。

    【讨论】:

      猜你喜欢
      • 2011-02-26
      • 2010-12-08
      • 1970-01-01
      • 2017-01-09
      • 1970-01-01
      • 2016-10-14
      • 2012-09-16
      • 2017-10-27
      • 1970-01-01
      相关资源
      最近更新 更多