On Thursday 02 March 2006 07:32 pm, Den Jean wrote:
> On Thursday 02 March 2006 07:20 am, Felipe Monteiro de Carvalho wrote:
> > Maybe I should try to detect if a drawing function was called outside a
> > paint event
>
> QWidget also descends from QPaintDevice
> which has the method bool QPaintDevice::paintingActive () const
Extra remark:
Do not use return value of QPainter::begin
To paint you need a QPainter.
You could do
create qpainter
isOk = qpainter.begin(qwidget-to-qpaintdevice)
if not isOk then
delete qpainter
exit
but this means that for every atomic drawing you would
create and destroy a qpainter, not good.
The one calling you should allready have created a qpainter
and called begin (maybe implicitly by constructing a qpainter with a
paintdevice from a widget) and you should have acces to that qpainter
to your painting on.
kind regards,
Den Jean
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives