QtService<QApplication> derived service not shown GUI when running as service
Hi,
I have create QT service as
MainService : public QtService<QApplication>
When i run it from Qt creator using -exec param, it display gui and sound properly.
When I install it as service and run, it will not show GUI, though sound is audible.
Can you please help to show GUI in service?
Thanks in advance for your time and support.
Thanks,
Sikander
hafiz_rafiq@hotmail.com
Re: QtService<QApplication> derived service not shown GUI when running as service
I don't think Windows services have a GUI. They run in the background, not in the windowing system. The debugger shows you the GUI you have created, but only because you are running it from within QtCreator as an application and not a service, which runs it as part of the windowing system. When you install and run it as an actual service, it has no access to the windowing system.
Are you sure you really want to create a service? It sounds like you might be confusing the idea of a server (as in client-server) with service.
Re: QtService<QApplication> derived service not shown GUI when running as service
Thanks for your reply. Actually, I want to run media files at computer boot up and before shutdown. To fulfill this requirement, I have made QT service which run at computer boot up. I have inherited my service from QtService<QApplication> just like this.
MainService : public QtService<QApplication>
but facing issue as it is not showing GUI when running as service.
I have tried another approach to launch separate app from Qt service using QProcess, but it is also running the app in background process and still not showing GUI.
Any hint how to fix this problem or redesign the app to show media files at computer startup or shutdown