eric_vi
12th August 2009, 19:25
within an MDI I have subwindows as QScrollArea with a QWidget scrollAreaWidgetContents inside
childScrollArea::childScrollArea(QWidget *parent) :
QScrollArea(parent),
m_ui(new Ui::childScrollArea)
{
scrollAreaWidgetContents = new QWidget();
childScrollArea->setWidget(scrollAreaWidgetContents);
scrollAreaWidgetContents->show();
}
void childScrollArea::paintEvent(QPaintEvent * /* event */)
{
QPainter painter(this);
painter.fillRect(QRect(0, 0, 300, 300), Qt::blue );
}
unfortunately the paint event in this case does not do any painting in the window!
what do i do wrong?
Thanks for any hint
childScrollArea::childScrollArea(QWidget *parent) :
QScrollArea(parent),
m_ui(new Ui::childScrollArea)
{
scrollAreaWidgetContents = new QWidget();
childScrollArea->setWidget(scrollAreaWidgetContents);
scrollAreaWidgetContents->show();
}
void childScrollArea::paintEvent(QPaintEvent * /* event */)
{
QPainter painter(this);
painter.fillRect(QRect(0, 0, 300, 300), Qt::blue );
}
unfortunately the paint event in this case does not do any painting in the window!
what do i do wrong?
Thanks for any hint