Results 1 to 3 of 3

Thread: QProcess and Kdesu

  1. #1
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QProcess and Kdesu

    Have some question.

    I start some command with Kdesu using QProcess.
    Qt Code:
    1. QString program = "Kdesu";
    2. QStringList arguments;
    3. arguments << ...;
    4. process->start(program, arguments);
    To copy to clipboard, switch view to plain text mode 

    How to terminate such process? If I do process->kill() it doesn't stop. AFAIU Kdesu starts command with root privileges, gets control to system and shuts down. Am I right?
    The way I see is to find PID of running command and than process->("Kdesu", QStringList() << "-t" << "kill" << $pidOfCommand I didn't try it yet but I think it has to work. Maybe there is another/simpler method?

  2. #2
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    3
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QProcess and Kdesu

    Strange, qProcess->kill() should be able to terminate the command program completely.

    How do you know the process is not yet killed?

  3. #3
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess and Kdesu

    Quote Originally Posted by ball
    Strange, qProcess->kill() should be able to terminate the command program completely.

    How do you know the process is not yet killed?
    Started process creates package and if I want to terminate the job I press stop button which invoke process->kill() but package creates.

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.