ok: this is my closing event for my main widget
void qtTest::closeEvent( QCloseEvent *event )
{
SystemClass* sys = m_widget->closeWindow();
sys->setDone();
sys->Shutdown();
delete sys;
sys = 0;
}
and this is my sys-> Run() function which is an endless loop which only stops if the done variable is set to true, which I do with my setDone() function:
void SystemClass::Run()
{
MSG msg;
bool result;
// Initialize the message structure.
ZeroMemory(&msg, sizeof(MSG));
// Loop until there is a quit message from the window or the user.
//done = false;
while(!done)
{
// Handle the windows messages.
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
// If windows signals to end the application then exit out.
if(msg.message == WM_QUIT)
{
done = true;
}
else
{
// Otherwise do the frame processing.
result = Frame();
if(!result)
{
done = true;
}
}
}
return;
}
The problem is that the Run function doesn't end because it is interrupted by the closing event. Do you know what I mean?
Bookmarks