Looks like Qt will do the caching itself in the future.

Abdel.

--- Begin Message ---
Hi Abdel,

On Monday, 04. des 2006 22:00 Abdelrazak Younes wrote:

> > We do some caching, but it is not possible to cache the results of
> > width() and boundingRect() as these values are dependent on the text
> > it is being called for and to cache every call would end up causing
> > the application to use a lot of memory.
>
> I know that but, at least for 8bit chars, I think there is no
> possibility for a char to have different width or boundingRect()? Or
> is there? If not, then it would make sense to cache at least those. By
> using a QHash (our solution within LyX), the memory overhead is very
> minimal (3 ints per font and per used char).
>
> AFAIK, only Arabic characters can present different widths depending
> on their position in the string. But there is only three different
> positions and thus three different widths possible.
>
> >   Are you thinking of other calls in
> > QFontMetrics that should have the return value cached?
> >
>
> Dunno, maybe leftbearing and rightbearing? I am most mostly interested
> in width() or boundingRect().

It sounds like there are some potential areas where some caching could
take place and since QFontMetrics is heavily used it may have a
postitive effect overall so I've created task 142225 for our developers
who will look into this further.  You can track this task using the
task tracker at:

        http://www.trolltech.com/developer/task-tracker
        http://www.trolltech.com/customer/task-tracker

Regards,
Andy
--
Andy Shaw, Senior Support Engineer
Trolltech ASA, Oslo - http://www.trolltech.com

======================================================================
Now Playing: Moving from Qt 3 to Qt 4 Webinars!
-------------------------
Trolltech and ICS will be hosting two webinars on Qt 3 to Qt 4 migration on
December 13 and January 9, 2007. The Moving from Qt 3 to Qt 4 webinars will
cover the basic steps of migration, the provided porting tools, and areas
of potential difficulty.    Learn more at
http://www.trolltech.com/products/qt/resourcecentre.
======================================================================



--- End Message ---

Reply via email to