In my Son paintEvent method. I create it y doing QPainter painter(this) or QPAinter * painter = new QPainter(this).Originally Posted by jacek
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).
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).Originally Posted by jacek
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




Reply With Quote
Bookmarks