Hello all
I need to programmatically close the dialog box opened by QFileDialog:getOpenFileName.
I know the parent window of the dialog.
This code not work(dialog box not close):
QList<QDialog*> widgets = findChildren<QDialog*>();
QList<QDialog*>::iterator cur = widgets.begin();
QList<QDialog*>::iterator end = widgets.end();
for (;cur != end; ++cur)
{
(*cur)->setParent(NULL);
(*cur)->reject();
}
I use qt 4.7.4
↧