I am making an audio app in PyQt that will display custom graphs and I'm trying to use the QGraphicsScene. I plan to have the timeline on top and the graph just below, with the y-axis always visible on the left (despite horizontal scrolling). There won't be a vertical scrollbar. I thought using a vertical graphics layout might be just what I need.

It seemed like QGraphicsWidget was the natural choice to subclass since QWidget is where custom widgets are made. However, as soon as I started, I couldn't find out how to paint the QGraphicsWidget. There's no paint event that I could find. I thought about creating a pixmap and adding it as a child, butI also couldn't find out how to add a child widget except upon creation of the child. This widget should scale, but it will need to change width as someone zooms in and out of the graph.

Then I tried using a regular QWidget and add it to the scene, but the graphics layout didn't recognize it.

I tried pyqtgraph, but there are too many changes I'm making and it's hard to find resources and help on it.

So what is the best approach to create such a widget? If I use QGraphicsWidget, how do I paint it? I will also need to add all the numbers and lines on the timeline.