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 绘制场景中的项目itemsnumItemsitems 中的项目数,是options 中的选项。options 是样式选项列表;每个项目一个。重新实现该函数可为该视图提供自定义项目绘制。

默认实现调用场景的 drawItems() 函数。

自 Qt 4.6 起,除非作为优化标志给出QGraphicsView::IndirectPainting 标志,否则将不再调用此函数。

另请参阅 drawForeground()、drawBackground() 和QGraphicsScene::drawItems()。

© 2025 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.