KWrappedListViewItem

David Faure faure at kde.org
Sat Jun 5 00:52:17 BST 2004


On Saturday 05 June 2004 01:32, Rob Kaper wrote:
> http://unixcode.org/img/atlantik/atlantik-20040530-kwrappedlistviewitem.png

Looks cool :)

> - creating a new fontmetrics every single time is ridiculous. Perhaps a
>   KWrappedListView can cache this and connect to a proper KDE signal in case
>   of a font change etc?

I'd rather let KListView cache it, just like we do in KIconView...
(see KIconView::itemFontMetrics). Then you can call it from KWrappedListView.

The qfontmetrics object is deleted from setFont(), I think that might be enough 
for the dynamic font change case.

> - QObject is expensive, but I haven't found another way to deal with
>  resizes.

For KDE4 this could be done with code in KListView and a new virtual in KListViewItem.
Before that it can be done with a dynamic_cast, if kwrappedlistviewitem is put in kdeui.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list