且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

向 QGraphicsItem 添加信号/插槽(QObject):性能受到影响?

更新时间:2023-02-06 11:35:43

此线程 建议另一种选择:创建一个 QObject 子类来代表您的 QGraphicsItems 发出信号.

This thread suggests another option: Create a QObject subclass to emit signals on behalf of your QGraphicsItems.

如果你有很多 QGraphicsItems 可以共享一个 QObject,那么这将比让每个 QGraphicsItem 继承 QObject 更轻量级.

If you have many QGraphicsItems that can share a single QObject, then this will be lighterweight than having each QGraphicsItem inherit QObject.