Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt about the pushbutton
Qt 6.11 is out! See what's new in the release blog

Qt about the pushbutton

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sharl
    wrote on last edited by
    #1

    Hello everyone i want the do shutdown the raspberry pi with qpushbutton it is possible and can somebody help me .

    jsulmJ 1 Reply Last reply
    0
    • S Sharl

      Hello everyone i want the do shutdown the raspberry pi with qpushbutton it is possible and can somebody help me .

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Sharl One possibility would be to execute "shutdown -h now" command using https://doc.qt.io/qt-5/qprocess.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • S Offline
        S Offline
        Sharl
        wrote on last edited by Sharl
        #3

        QProcess process;
        process.startDetached("shutdown -h now");

        like this ?

        jsulmJ 1 Reply Last reply
        0
        • S Sharl

          QProcess process;
          process.startDetached("shutdown -h now");

          like this ?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Sharl No

          QProcess process;
          process.startDetached("shutdown", QStringList() << "-h" <<  "now");
          

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • S Offline
            S Offline
            Sharl
            wrote on last edited by
            #5

            i can't try right now but i write result here. Thank you.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Sharl
              wrote on last edited by
              #6

              thank you very much it's worked

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved