Bug 157643

Summary: Unexpected behavior on Plasma::BoxLayout when adding/removing items
Product: [Plasma] plasma4 Reporter: Juan González <kde_devel>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Described test
improved applet.cpp that works properly

Description Juan González 2008-02-11 02:26:49 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          gcc versión 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) 
OS:                Linux

I want to use Plasma::BoxLayout in my applet to show a collection of items, and when clicking on one of them I want to hide the other items and show a different item with information relative to the selected item, but it doesn't remove the items from the layout as I would expect. Maybe I didn't explain it correctly but...

As code is much better than words I've created a little test case that show the bad behavior.
I will attach it to this bug.
Comment 1 Juan González 2008-02-11 02:27:48 UTC
Created attachment 23527 [details]
Described test
Comment 2 Aaron J. Seigo 2008-02-11 05:17:17 UTC
you also need to hide/show the items.

side note:

* you don't need contentSizeHint for what you are using it for, just use setMinimumContentSize

* the set up of the GUI should really be done in init(). it's not only better for startup time, it's also likely that eventually you may want configuration values, access to the scene, etc. best to wait until init()

see attached file for a version that works well.
Comment 3 Aaron J. Seigo 2008-02-11 05:18:01 UTC
Created attachment 23530 [details]
improved applet.cpp that works properly