Skip to content

After receiving the signal, a dialog box pops up #200

@libaineu2004

Description

@libaineu2004

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

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();
    return a.exec();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions