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. How to detach qt gui app from its parent

How to detach qt gui app from its parent

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.5k Views 1 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.
  • A Offline
    A Offline
    aashish.lg
    wrote on last edited by
    #1

    I am starting a Qt gui app using QProcess::start() call.
    When I am closing my qt app , I would like to detach it from its parent, please advice how to detach it using Qt way.

    Also when I say qApp->exit(1), in my Qt application then it takes around 3~4 seconds to terminate itself completely. What is the faster way to terminate a Qt app by itself.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      QProcess::startDetached().

      As for exiting, profile your app with valgrind, you're probably using many resources that need to be cleaned and it takes time. You can kill the process, but that is not really a good way to do things.

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aashish.lg
        wrote on last edited by
        #3

        Hi Thanks for your suggestion. But I am looking to detach my client process from its parent within the code of client.

        startDetached() will launch my client process as a separate process, that I dont want. I just wanted to run it as a child process only , and in some button click event of my child process I wanted to break the child-parent relationship.

        Please advice.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          "Fork()":http://en.wikipedia.org/wiki/Fork_(operating_system).

          I don't think the OS will allow you to detach from within the child.

          (Z(:^

          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