On 3/3/06, Den Jean <[EMAIL PROTECTED]> wrote:
> 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
Currently I don't use QPainter::begin at all, because I only handle
painting inside OnPaint and there you don't need to call it.
> but this means that for every atomic drawing you would
> create and destroy a qpainter, not good.
I use one QPainter per Canvas. Created when the Canvas is created and
destroyed when the Canvas is destroyed. Take a look at
lcl/interfaces/qt/qtprivate.pas to see how I implemented
TQtDeviceContext
> 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.
Is painting outside OnPaint important? If Gtk also doesn't allow it,
then it shouldn't be important. I'm thinking about leaving paint the
way it is and focus on getting those example programs working =)
Currently only hello example is fully functional. At the moment I am
trying to implement more events.
thanks,
--
Felipe Monteiro de Carvalho
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives