Results 1 to 2 of 2

Thread: shutdown the system with progress bar

  1. #1
    Join Date
    Jul 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default shutdown the system with progress bar

    Hi, I am writing a Qt Application for embedded device. In this application I want to implement a "shutdown" button. The OS is linux. How can I make the system shutdown and show the shutdown process on a progress bar. And how can I display a message: "It's now safe to turn off" after the system shutdown?

    Thank you very much

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: shutdown the system with progress bar

    You can start a shutdown with all sorts of commands as root, for example any of:
    Qt Code:
    1. shutdown -h now
    2. telinit 0
    3. halt
    To copy to clipboard, switch view to plain text mode 
    Which suits your system depends on your system. QProcess can help here, but that's where involvement of Qt ends. Once started, the shutdown is entirely outside of your application's control; orchestrated by init running through whatever is scheduled in the inittab. You can use the shutdown scripts (once again system dependent) to do some fancy display stuff at a low level, but that has nothing to do with your application. Your Qt application will be terminated at some indeterminate point in the shutdown (probably early) so you cannot use it to display useful "I'm finished" message.

Similar Threads

  1. Shutdown on Mac failing
    By ntp in forum Qt Programming
    Replies: 4
    Last Post: 11th December 2010, 01:41
  2. Replies: 1
    Last Post: 15th August 2010, 11:13
  3. Replies: 3
    Last Post: 29th November 2009, 07:24
  4. Finalization on system shutdown
    By nomadoro in forum Qt Programming
    Replies: 4
    Last Post: 30th October 2009, 19:30
  5. Replies: 4
    Last Post: 11th March 2008, 11:44

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.