Results 1 to 3 of 3

Thread: QtService<QApplication> derived service not shown GUI when running as service

  1. #1
    Join Date
    Jul 2017
    Posts
    3
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Question 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

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,243
    Thanks
    303
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default 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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jul 2017
    Posts
    3
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default 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

Similar Threads

  1. Replies: 3
    Last Post: 20th December 2013, 21:17
  2. Replies: 0
    Last Post: 16th December 2010, 09:32
  3. DBus service name
    By charlesf in forum Qt Programming
    Replies: 6
    Last Post: 4th May 2009, 08:53
  4. Creating QDS service
    By bowser in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 29th October 2007, 12:12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.