Obsolete Members for QGraphicsView
QGraphicsView 类的以下成员已被废弃。提供这些成员是为了确保旧源代码能够继续运行。我们强烈建议不要在新代码中使用它们。
受保护的函数
(deprecated) virtual void | drawItems(QPainter *painter, int numItems, QGraphicsItem *[] items, const QStyleOptionGraphicsItem[] options) |
成员函数文档
[virtual protected, deprecated] void QGraphicsView::drawItems(QPainter *painter, int numItems, QGraphicsItem *[] items, const QStyleOptionGraphicsItem[] options)
此函数已弃用。我们强烈建议不要在新代码中使用它。
在绘制背景之后、绘制前景之前,使用 `painter` 在场景中绘制 `items ` 中的项目。`numItems ` 是 `items ` 中的项目数量,`options` 是 `options` 中的选项。`options ` 是一个 `styleoptions` 列表;每个项目对应一个选项。重写此函数可为该视图提供自定义的项目绘制功能。
默认实现会调用场景的 drawItems() 函数。
自 Qt 4.6 起,除非将 `QGraphicsView::IndirectPainting ` 标志作为优化标志指定,否则该函数将不再被调用。
另请参阅 drawForeground()、drawBackground() 和QGraphicsScene::drawItems()。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.