minimumWidth() for TreeView in KJanusWidget

Ravi ravi at kde.org
Mon Mar 1 21:11:17 GMT 2004


On Monday 01 March 2004 03:42 pm, Tobias Koenig wrote:
> Well, I already thought about such a solution, but that would require to
> reflect this method in every container widget which uses KJanusWidget,
> for example KDialogBase, and that's bad.
>
> Concerning the performance: the patch adds just some pointer
> dereferences and additions in a while loop.
> Since KJanusWidget is mainly used for configuration dialogs and the tree
> will be < 5x nested this shouldn't really be a performance problem at
> all.

The performance issue is not in KJanusWidget but in the faces it shows. In one 
of my applications, I used it to show dynamically generated help files (which 
were very large) using khtml[1], and flicker during re-layout was a major 
problem. The issue is that KJanusWidget != KDialogBase. So, I would add the 
ensureVisible() solution in KJanusWidget and call it from KDialogBase[2] 
thereby catching most uses of KJanusWidget while still leaving the current 
behavior as an option for other cases.

Regards,
Ravi

1. It can be construed as a design flaw in my program, but I'd argue against 
repeating the mistakes of the X developers who claim that X is fast (which it 
is), and that toolkit authors should write cleverer code to only compute 
things that are shown on screen, which is generally way more difficult and 
nearly impossible to maintain with large widget hierarchies.

2. Perhaps as a property in KJanusWidget with appropriate get/set methods.





More information about the kde-core-devel mailing list