PenPen use the second one , which is more flexible , but the code to get started is a little bit complex than using widget. I am thinking about to pack a QWidget class so that it is more easy to get started. The concept should be much clear when the demo code is ready.