title: How to shutdown Linux using C++ or Qt without call to "system()"?
body: <p>I want to shutdown an Embedded Linux when a close button is pushed on the UI. I know I can do it with a call to <code>system</code>:</p>
  
  <pre><code>system("shutdown -P now");
  </code></pre>
  
  <p>Ref: <a href="http://www.programmingsimplified.com/c-program-shutdown-computer" rel="noreferrer">Link</a></p>
  
  <p>But knowing that using <code>system</code> is not advised, I'ld like to know if there is another way in C++ to do this (if there is also a specific way to do this using Qt, I'ld also like to know it although a general C++ method is more important).</p>