hi,

how can i draw on a widget outside method paintevent() ?
in the following code the lines are drawn in paintevent(9 but not
in mousemoveevent(). i tried several attributes such as
Qt::WA_PaintOutsidePaintEvent but without success.


void paintEvent(QPaintEvent *e)
{
QLabel:aintEvent(e);
QPainter p(this);
p.setPen(QColor(146, 146, 146));
p.drawRect(0, 0, width() - 5, height() - 5);
}


virtual void mouseMoveEvent ( QMouseEvent * e )
{
QPainter p(this);
QPen pen;
pen.setColor(QColor(200,100,30));
p.setPen( pen );
p.drawLine(QPoint(0,0),e->pos());
p.drawLine(0,0,100,60);
}


any ideas?

jh