[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Small paint question
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-05-31 23:04:31
[Download RAW message or body]

On Thursday 31 May 2001 23:06, Lenny wrote:
> Hi,
> 
> im currently stuck with a problem which i dont know how to handle best.
> I want the views to "paint" the objects instead of the document, because i 
> want to pass an inidividual zoom-factor per view. Thats because 
> qpainter-scaling has some nice rounding-errors and i dont want the handles to 
> also scale while zooming, like e.g. killu does. i think its better to scale 
> in "user-space" opposed to qpainter-scaling.

Sure. This is partly what KWord does (it doesn't have a zoom value per view
though, because of fonts that need to be made bigger). But it doesn't use qpainter
scaling, that's what I mean.

> document's paintContent() calls all views' paintEverything() in a loop.

No. The document's paintContent is called when the document is embedded
into another koffice app, so in this case there are _no_ views.
It has to be able to paint the contents without using a view.
In KWord, for instance, this means it calls a paint() method on each frameset.

Views get painted in their drawContents() method (assuming you're using QScrollView).
See KWord's KWCanvas.

> ok, views cant access the document-data to make these data-objects draw 
> themselfes, because they are supposed to be private. should i make them 
> public (as a hack) or should i introduce a new function or is there already a 
> nice function to access them for drawing? there are 5 paint*-functions in 
> koDocument, but i dont know which one i could borrow for the next step.

None. Those methods are all about embedded objects.

> hm, in general this "document => view => document => objects" chain looks a 
> bit awkward to me.
> What could i do better?

view => document (with the zoom, and painter etc. as parameters) => objects (same params)

or

view => objects   and  document => objects when embedded  

(KWord does the latter, but if you want the objects to be accessible by the doc
only you can go with the first scheme).

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic