Results 1 to 2 of 2

Thread: How to turn off PC?

  1. #1
    Join Date
    Jan 2009
    Location
    Prague, CZE
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation How to turn off PC?

    Hi,
    i need to turn off my PC with QT. Its posible or not?

    Thanks,
    wydesenej

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to turn off PC?

    Hi,

    Yes, but it's not really a Qt behavior.

    You have to start a Process that calls "shutdown", that is a console app that shutdowns the computer.
    Qt Code:
    1. QProcess::startDetached("shutdown -s -f -t 00");
    To copy to clipboard, switch view to plain text mode 
    Òscar Llarch i Galán

Similar Threads

  1. turn off collision detection?
    By Deacon in forum Qt Programming
    Replies: 14
    Last Post: 30th December 2008, 17:37
  2. Turn off computer
    By swiety in forum KDE Forum
    Replies: 1
    Last Post: 5th January 2008, 15:40
  3. Turn off backing store
    By Rayven in forum Qt Programming
    Replies: 4
    Last Post: 8th February 2007, 18:01

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.