{"id":22370038,"url":"https://github.com/andreicherniaev/qcoreapplication_quit_example","last_synced_at":"2025-06-28T11:06:36.860Z","repository":{"id":111402445,"uuid":"588432186","full_name":"AndreiCherniaev/QCoreApplication_quit_example","owner":"AndreiCherniaev","description":"simpe example How to exit after QCoreApplication::exec()","archived":false,"fork":false,"pushed_at":"2024-09-16T17:47:24.000Z","size":317,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T16:26:26.224Z","etag":null,"topics":["example","qt","sigint"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreiCherniaev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-13T05:13:47.000Z","updated_at":"2024-09-16T17:47:27.000Z","dependencies_parsed_at":"2024-09-08T15:27:10.695Z","dependency_job_id":"3d7f0efa-7738-4c6b-b0bc-226205be321c","html_url":"https://github.com/AndreiCherniaev/QCoreApplication_quit_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndreiCherniaev/QCoreApplication_quit_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiCherniaev%2FQCoreApplication_quit_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiCherniaev%2FQCoreApplication_quit_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiCherniaev%2FQCoreApplication_quit_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiCherniaev%2FQCoreApplication_quit_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreiCherniaev","download_url":"https://codeload.github.com/AndreiCherniaev/QCoreApplication_quit_example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiCherniaev%2FQCoreApplication_quit_example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262419807,"owners_count":23308100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","qt","sigint"],"created_at":"2024-12-04T19:31:57.638Z","updated_at":"2025-06-28T11:06:36.843Z","avatar_url":"https://github.com/AndreiCherniaev.png","language":"C++","readme":"# QCoreApplication_quit_example\n This is simple example How to exit after QCoreApplication::exec()\n \n Run app and after 3 second QCoreApplication_quit_example will close automatically with message \"good bye\".\n \n To exit from you infinite cycle QCoreApplication::exec()\n try this\n \n    QTimer::singleShot(1000, this, \u0026rial::closeApp); //if you need process some code in closeApp()\n or this\n \n    QTimer::singleShot(1000, QCoreApplication::instance(), SLOT(quit())); //if you need quit() only\n\nAlso you can use Ctrl+C to exit. If user send Ctrl+C signal QCoreApplication_quit_example will use non-Qt function SigInt_Handler(). It tested on Ubuntu.\n\n# QCoreApplication_quit_SIGINT_example\nQCoreApplication_quit_SIGINT_example is more powerfull then QCoreApplication_quit_example. If user send Ctrl+C signal QCoreApplication_quit_SIGINT_example will use Qt non-static method rial::handleSignal(). In this method Qt start QTimer for 3 seconds and after do closeApp(). If user don't press Ctrl+C in console for QCoreApplication_quit_SIGINT_example this app will wating forever.\n\n# How run?\nYou can run this apps using Qt Creator. You can use external terminal if you need use this way\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Qt Creator. Run proj in external terminal\" src=\"https://github.com/AndreiCherniaev/QCoreApplication_quit_example/blob/38b9c07d8a77a3e9122f64366c1c3d31b9c12061/Qt%20Creator.%20Run%20proj%20in%20external%20terminal.png?raw=true\" width=\"800\"\u003e\n  \u003cbr\u003e\n    \u003cem\u003eRun proj in external terminal\u003c/em\u003e\n\u003c/p\u003e\n\nYou can send SIGINT by Ctr+C key. But also you can send SIGINT using Debug mode via GDB console. Before sending \"signal 2\" don't forget make Pause!\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Qt Creator. Debug using gdb creator. Emit signal 2 via gdb console\" src=\"https://github.com/AndreiCherniaev/QCoreApplication_quit_example/blob/38b9c07d8a77a3e9122f64366c1c3d31b9c12061/Qt%20Creator.%20GDB.%20signal%202.png?raw=true\" width=\"800\"\u003e\n  \u003cbr\u003e\n    \u003cem\u003e\tSIGINT by GDB in Qt Creator\u003c/em\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreicherniaev%2Fqcoreapplication_quit_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreicherniaev%2Fqcoreapplication_quit_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreicherniaev%2Fqcoreapplication_quit_example/lists"}