PDA

View Full Version : Reimplementig paint event



ale301168
12th November 2009, 23:02
Dear everybody,

I have the following situation:

class myClass : public QWidget
{
...
protected void paintEvent (QPaintEvent *);
}

MainWindow::MainWindow (...)
{
...
QTabWidget * lTabWidget = new QTabWidget ();
myClass * lMyClass = new myClass;
ltabWidget->addTab (lMyClass, "First tab");
lMyClass = new myClass;
ltabWidget->addTab (lMyClass, "Second tab");
...
}

Well, Qt draws the tabs but never launch my re-implemented
paint event of myClass (which I need !).

Could you explain why and suggest me a way to get the paint
event running ?

Best Regards

wysota
13th November 2009, 00:48
We'd have to see the code for the event handler and probably a bit of code around it.

jano_alex_es
13th November 2009, 07:21
EDITED: Sorry, my bad.

wysota
13th November 2009, 10:26
Don't confuse the man. He is reimplementing paintEvent for a widget, not paint for a graphics item. His declaration is correct and it's in protected section which is also correct.

jano_alex_es
13th November 2009, 11:11
ups, sorry!, I missunderstood the problem. I edit the message in order to avoid confusions.