Qt service with gui
-
@JonB no is not what I asked. You should re read my first post.
wrote on 6 Jul 2024, 19:08 last edited by JonB 7 Jun 2024, 19:09@franco-amato said in Qt service with gui:
You should re read my first post.
I have read it many times, thanks. Best of luck showing a UI from a Windows service.
-
@franco-amato said in Qt service with gui:
You should re read my first post.
I have read it many times, thanks. Best of luck showing a UI from a Windows service.
wrote on 6 Jul 2024, 19:37 last edited by@JonB said in Qt service with gui:
@franco-amato said in Qt service with gui:
You should re read my first post.
I have read it many times, thanks. Best of luck showing a UI from a Windows service.
If you had read it you would have seen that I stated the following: "I know that a Windows service usually doesn't have a GUI and I'm not sure it can have one". What I asked is whether the path of service is the right path or if there are other solutions to achieve my need
-
@JonB said in Qt service with gui:
@franco-amato said in Qt service with gui:
You should re read my first post.
I have read it many times, thanks. Best of luck showing a UI from a Windows service.
If you had read it you would have seen that I stated the following: "I know that a Windows service usually doesn't have a GUI and I'm not sure it can have one". What I asked is whether the path of service is the right path or if there are other solutions to achieve my need
wrote on 6 Jul 2024, 19:44 last edited by JonB 7 Jun 2024, 19:46@franco-amato said in Qt service with gui:
If you had read it
Thanks again. It's always nice to try to help people, just what we like to hear.
I read your post carefully, as I said. All I ever answered was that I think you will find it difficult to run a UI from a service. You asked if that was the "right path", I suggested it is not. Sorry if you didn't want to hear that. Why don't you leave me out now, thanks.
-
Hi,
One possible cheat is that you use a QProcess to start a new instance of your application if somebody stops it.
From a design point of view, you can forbid your user to close the application by handling the close event yourself. A starting point might be the QSystemTrayIcon example.
Note that this does not protect your application from getting killed but you can still handle the usual interruption signals.
The system service + client application combo is still worth exploring as you can have the service providing the core functionality and the application being merely a front-end.wrote on 6 Jul 2024, 20:03 last edited by@SGaist Can you help with a small example regarding this "One possible cheat is that you use a QProcess to start a new instance of your application if somebody stops it." ?
-
// rest of the code int result = app.exec(); QProcess::startDetached("your_application"); return result;
-
// rest of the code int result = app.exec(); QProcess::startDetached("your_application"); return result;
wrote on 6 Jul 2024, 20:21 last edited by@SGaist said in Qt service with gui:
// rest of the code int result = app.exec(); QProcess::startDetached("your_application"); return result;
It worked but now I am not able to stop it anymore :)) and I am the admin
-
You will have to implement some checks to determine who stopped the application.
Note that you also need to implement graceful shutdown for when you stop/restart your machine.
-
You will have to implement some checks to determine who stopped the application.
Note that you also need to implement graceful shutdown for when you stop/restart your machine.
wrote on 7 Jul 2024, 14:03 last edited by@SGaist said in Qt service with gui:
You will have to implement some checks to determine who stopped the application.
Note that you also need to implement graceful shutdown for when you stop/restart your machine.
It's not clear what you mean with graceful shutdown. Can you give an example please?
-
Simply when you want to shutdown or reboot the machine for example when applying security fixes, kernel update, system updates, etc.
-
wrote on 15 May 2025, 11:13 last edited by
@franco.amato Will you be able to make QT service with GUI or launch QT app with GUI from Qt service?
-
wrote 25 days ago last edited by
Yes I am
-
wrote 24 days ago last edited by
If you want to prevent that a user to close you app you shoud:
- implement the closeEvent() event to reply "no".
- work with machine criteria to disable task manager etc to normal users.
Hi, if you want to try to use your app (with gui) as windows service you can use this.
https://www.denisgottardello.it/InstallAsService/index.php
The gui will not be visible.