-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After receiving the signal, a dialog box pops up #200
Comments
Can you verify the exit code of your application. I bet it's neither |
I add std::cout print information. But there is no return value because the exe will crash. int main(int argc, char *argv[])
{
SingleApplication a(argc, argv);
QObject::connect(&a, &SingleApplication::instanceStarted, [=]() {
QMessageBox::information(0, QObject::tr("info"), QObject::tr("I am running"));
});
Form w;
w.show();
int ret = a.exec();
std::cout << ret << std::endl;
return ret;
} |
What's your exit code? |
I am using Windows operating system, and I cannot capture this exit code when the exe crashes. Can you run my source code to see if it crashes as well? |
My source code implements: after receiving the instanceStarted signal, a prompt dialog box pops up.
But this causes a problem:
After clicking OK, the dialog box closes, but the main process also exits.
How can I solve this problem?
Windows 11/Qt5.15.2/VS2019 x64
The text was updated successfully, but these errors were encountered: