i am having a problem in clearing my vertical layout from widgets.
i am adding QLables and QPushButtons in a specified vertical layout ( ui->verticalLayout->addWidget(myPushButtonArray[k]); ).
i want to clear all the widgets inside this vertical layout.
i have used :

QLayoutItem *child;
while ((child = ui->verticalLayout->takeAt(0)) != 0)
delete child;
it clears all the widgets inside the layout, but do not refresh the vertical layout ( like a shawdow of these widgets is still present )
how can i update the layout or refresh it, or something like this to clear all the widgets.

Best Regards.