QGraphicsWidget inherits from QGraphicsObject, which inherits from QGraphicsItem, which has a QGraphicsItem::paint() virtual method.

However for your purposes you might find is easier to use QGraphicsProxyWidget to host a ready-to-go scientific graphics widget like Qwt or QCustomPlot instead of rolling your own.