Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] How to close external application or process from QT
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How to close external application or process from QT

Scheduled Pinned Locked Moved General and Desktop
external applickill
5 Posts 2 Posters 3.7k Views 2 Watching
  • 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.
  • M Offline
    M Offline
    mjzarrin
    wrote on last edited by mjzarrin
    #1

    i need to close all browser of my system from QT.
    It must be work on Windows and Linux. i found Qprocess. I searching hours for an example of using kill or terminate for external application like google chrome but failed. can anyone help me please.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You would first need to get a list of the current running instance using e.g. ps -A. You can then parse that to retrieve the PID's of the application you want to stop and then use that to send the proper kill command.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        You would first need to get a list of the current running instance using e.g. ps -A. You can then parse that to retrieve the PID's of the application you want to stop and then use that to send the proper kill command.

        Hope it helps

        M Offline
        M Offline
        mjzarrin
        wrote on last edited by
        #3

        @SGaist
        Thank you very much.
        i find solution based on your idea and the program can close any external app with it's name.
        thank you

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          Also, while browsing the forum, consider up-voting the answers that helped you, that will make them easier to find for other users :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            You're welcome !

            Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

            Also, while browsing the forum, consider up-voting the answers that helped you, that will make them easier to find for other users :)

            M Offline
            M Offline
            mjzarrin
            wrote on last edited by
            #5

            @SGaist
            Ok my dear friend.
            Thank you again for your advise.

            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