[Qt-interest] QVBox removeItem

Tamas Nagy ngy_tms at yahoo.com
Sat May 15 19:22:19 CEST 2010


Hello!

I have Qt 4.6, and i want to remove all children of the widget.
I would like to write a Clear() function.

If i switch the array to dynamically allocated, so i use
QList<QPushButton*> buttons = new QList<QPushButton*>

These buttons are added to the QVBox.

And i try removeItem which is not documented on the Qt website.

while(vbox->children->count())
{
    vbox->removeItem(0);
}

Is it correct?






      



More information about the Qt-interest-old mailing list