[Uml-devel] Re: karbon/umbrello

Dirk Schönberger dirk.schoenberger at sz-online.de
Fri May 16 11:24:11 UTC 2003


> > In kpainterchartview.png the upper chart is rendered using defualt
> > QPainter, while the lower part is rendered using KPainter (and a libart
> > based paint device)

> I'm not really into graphics, so I dont understand the relationship
between
> KPainter, libart and the paint devices... =((

KPainter and paintdevices work similar than QPainter and QPaintDevice.
Basically you have your frontend, KPainter/KPainter, which defines the
available methods.
There exist multiple backends which are supposed to implement these
frontends.
Dependent upon your requirements you can hopefully choose from a set of
paint devices.
For KPainter this currently means:

- the LibartPaintDevice uses libart (a render library). It renders to a
QImage which is later blittet to the output. The paint device supports
anti-aliased rendering and opacity effects. Normally it is used for screen
output, it is less suited for printing

- the QPainterPaintDevice uses QPainter calls for rendering. It can render
to any QPaintDevice which exists for QPainter, like QPixmap, QWidget,
QPrinter. This paint device doesn't render anti-aliased graphics or opacity,
but you may e.g. use it for printing. The printing results may or may not be
sufficient.

> > The negative part on using KPainter is that you have to re-implement
> > QCanvas.

> well.. as far as I can tell (which is not too far =), the most difficult
would
> be collision detection, and detecting which parts of the canvas need to be
> redrawn on which views

I assume with collision detection you mean hit tests with mouse coordinates?
For optimized redrawing, this would indeed a very nice feature, but I have
not yet an idea how to imlplement this.

> >
> > I haven't looked further, but I think that instead of registering a at a
> > widget factory and a tool factory, you should register widgets/shapes,
> > controllers and KActions at a action manager. The action manager is part
of
> > the KDE libs, and most applications use this framework already.

> I'll try to look at it.  can you point me to an example of where this is
done?

Google found some tutorials and descriptions how to implement this:

http://edu.kde.org/development/kaction.php
http://www.konqueror.org/componentstutorial/page6.php
http://devel-home.kde.org/~larrosa/tutorial/p9.html
http://kate.kde.org/doc/pluginhowto.php

Regards
Dirk











More information about the umbrello-devel mailing list