Quote Originally Posted by jacek
When do you draw on that widget? And how do you create QPainter?
In my Son paintEvent method. I create it y doing QPainter painter(this) or QPAinter * painter = new QPainter(this).
As my son inherit from Mother (that inherit from Qwidget) this is suppose to have a link with the widget I want to draw on ? I can t do painter(parent).


Quote Originally Posted by jacek
It is a widget, since it inherits from Mother which is derived from QWidget.
Ok, in my vision Son is an Object that is not a widget because it's not a "window", it s just a class that can draw on widgets (so it must inherit from QWidget indirectly with Mother).

That s really weird, in my Son paintEvent method I tried doing
painter.fillRect(2,2,width()-4, height()-4, QBrush(QColor(0,0,0)));
and in my Widget (Bck1) in top left corner a little rectangle, maybe 50*30 pixels has become black instead of red !!! and I never gave such dimensions for the widget