PDA

View Full Version : QApplication breaks when QMessageBox left open awhile



sgmurphy19
2nd October 2008, 17:21
I run the following during an update application:
app->exec();

Then I give the user an option to update:
if(QMessageBox::question(this, QString("New Update Available"), QString("A new update is available, download it now?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)

now here's the thing...
If the response comes quickly, say within 10 seconds then app->quit() works as expected.

But if the user waits a long period of time before responding the Application crashes.

Any direction as to why this occurs would be appreciated.

Sean

will49
2nd October 2008, 20:24
Take a look at these threads. May be something relating to "requestFinished" signal if you are using Qhttp.

http://www.qtcentre.org/forum/f-qt-programming-2/t-add-check-for-updates-feature-11246-post81459.html#post81459

http://www.qtcentre.org/forum/f-qt-programming-2/t-some-errors-if-i-dont-click-on-qmessagebox-button-11437.html

sgmurphy19
3rd October 2008, 16:46
Thanks. Did so many searches, but never came across those. Funny how I walked through the same steps. But adding Qt::QueuedConnection at the end of the Signal/Slot worked perfectly for me too.

Thanks for pointing me in the right direction!