You should set an external central widget and paint on that widget and not on the main window itself.
By the way, how is this question related to Qt Designer?
The central widget can be anything inheriting from QWidget, but I think Qt Designer restricts it to be a QWidget. Just create any custom widget, reimplement the paintEvent(), add corresponding widget in the Designer and promote it.
As I have said previously:
So, in another words.
WRONG: "void MyMainWindow::paintEvent(QPaintEvent* event)"
CORRECT: "void MyCentralWidget::paintEvent(QPaintEvent* event)"
J-P Nurmi
Shuchi Agrawal (18th January 2007)
Bookmarks