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

List:       kde-core-devel
Subject:    Re: KMix major changes: Your help is needed
From:       Matthias Ettrich <ettrich () troll ! no>
Date:       1999-11-16 22:27:11
[Download RAW message or body]

On Wed, 17 Nov 1999, Christian Esken wrote:
> Am Die, 16 Nov 1999 schrieb Matthias Ettrich:
> > > If Qt would have working layouts AND supported removing items from
> > > layouts when I wrote KMix, kmix would have been non-fixed size.
> > 
> > Yes, layout was a pain in the a*** back in these days. Just for the records:
> > removing items from QLayout works fine these days.
> 
> Tell me the methods. I hunted for them when rewriting the KMix core last
> week, but for removing I only found this remove-ALL-items() method in
> the layout class.
> 
> I browsed the layout documentation and the Qt layout introduction 
> (layout.html).

Usually, one doesn't need to remove layouted items manually. Qt does it
automatically for you when you delete a widget, for example. Also when you hide
widets (QWidget::hide() ), the layout will be recalculated properly with the
hidden widgets ignored. Usually that's all one needs. What is so special about
kmix's GUI?

Anyway, for real fancy stuff (whatever that might be), simply use a
QLayoutIterator, iterate until you found your widget and call takeItem() on the
iterator:

	QLayoutIterator it = yourLayout->iterator();
	QLayoutItem *item;
	while ( (item = it.current() ) ) {
	    if ( item ==theThingYouDoNotWantToHaveHereAnyLonger) { 	
		it.takeCurrent(); 
		iyourLayout->invalidate(); 
		break;
	    }
	}


Matthias

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

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