Commit 480f8235 authored by Ilya Lysenkov's avatar Ilya Lysenkov

Qt: fixed destroyAllWindow crash (patch #794)

parent f010539a
......@@ -988,16 +988,25 @@ void GuiReceiver::destroyAllWindow()
//#TODO check externalQAppExists and in case it does, close windows carefully,
// i.e. apply the className-check from below...
qApp->closeAllWindows();
}else{
foreach (QObject *obj, QApplication::topLevelWidgets())
}
else
{
bool isWidgetDeleted = true;
while(isWidgetDeleted)
{
isWidgetDeleted = false;
QWidgetList list = QApplication::topLevelWidgets();
for (int i = 0; i < list.count(); i++)
{
QObject *obj = list.at(i);
if (obj->metaObject ()->className () == QString("CvWindow"))
{
delete obj;
isWidgetDeleted = true;
break;
}
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment