PDA

View Full Version : QToolBar paintEvent



^NyAw^
9th May 2012, 17:11
Hi,

I'm trying to show an image into a QToolBar. To do this I redefined the paintEvent method.
QToolBar shows what you can see on the attached image.7710
The problem is that when I change the paintEvent, it is not shown. Maybe I have to tell base class to paint before my image painting? How I have to do this?

Thanks,

amleto
9th May 2012, 18:29
class MyToolbar : public QToolbar
{
...
};

void
MyToolbar::paintEvent(... event)
{
QToolbar::paintEvent(event);

// do your own stuff.
}

what do you mean by 'change the paint event' ?

^NyAw^
9th May 2012, 18:34
Hi,

Thanks, it works. "change the paint event" means "redefine the paint event". It's a litteral translation of my thinking language. :P