For custom drawing , you will need to override the QWidget::paintEvent function.