我有一个覆盖drawBackground
QGraphicsScene 的类,但我的drawBackground
实现从未被调用。
class CtrlCutScene : public QGraphicsScene
{
Q_OBJECT
public:
CtrlCutScene(QObject *parent = 0);
~CtrlCutScene() {}
protected:
//added override to make the compiler check that signatures match
virtual void drawBackground(QPainter *painter, const QRectF &rect) override;
};
知道我做错了什么吗?