[Kde-graphics-devel] Re: [cairo] Qt example in cairo-demo

Richard Moore richmoore44 at gmail.com
Thu Jan 27 00:43:36 CET 2005


On Wed, 26 Jan 2005 11:17:09 -0500, Zack Rusin <zack at kde.org> wrote:
> 2) Because of 1 that means that we'd be looking into just creating a
> class that abstracts Cairo calls. But the question is: is it really
> easier to do:
> QCairoPainter painter(cairo);
> painter.moveto(20,0);
> painter.relLineTo(40, 40);
> painter.relLineTo(-40,0);
> painter.closePath();
> rather than
> cairo_move_to( cr, 20, 0 );
> cairo_rel_line_to( cr, 40,  40 );
> cairo_rel_line_to( cr, -40, 0 );
> cairo_close_path( cr );

One big difference is that with the first example I can switch
back-ends with a single line of code. This is a big deal when you try
to do something you hadn't thought of when you wrote the code. The
first example is also easier to read if you're used to working with Qt
style APIs as you don't need to 'change gear'.

Rich.


More information about the Kde-graphics-devel mailing list