PDA

View Full Version : QObjectList porting problem



batileon
16th July 2008, 08:31
From QT3 to QT4, QObjectList should have changed.
How can I convert the following QT3 code to QT4?


QObjectList *l = this->queryList( "TableButton" ); // get all its children which is TableButton
QObjectListIt it( *l ); // iterate over the buttons

while ( it.current() != 0 )
{
// for each found button...
((TableButton *)(it.current()))->close( TRUE );
++it;
}
delete l;

Thanks!

caduel
16th July 2008, 09:23
foreach(TableButton *tb, findChildren<TableButton*>())
tb->close(TRUE);


Shorter than before, right?

HTH