Results 1 to 11 of 11

Thread: Qt4 QProcess Problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4 QProcess Problem

    Ok 4.0.5 was wrong, its 4.0.1-5 but I think the "-5" comes from debian.

    Thank you for the hint of TT tasktracker. I think it has something to do with this bug:
    http://www.trolltech.com/developer/t...entry&id=90183
    I have tried differnd positions for the call of QProcess::startDetached(). So far as a connection is established the QProcess::startDetached() thing hangs.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Qt4 QProcess Problem

    Do you use hostLookup? And do you really need startDetatched? Maybe you can cope with simple start?

  3. #3
    Join Date
    Jan 2006
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4 QProcess Problem

    I do not use hostLookup directly, but I use QTcpSocket.
    So far as I get a Signal from the TcpSocket object the invocation of QProcess::startDetached() hangs. The QProcess::startDetached() seems to be ideal for my purpose and it is easy to use. I will try it with start(). By start() I have to manage the memory release by myself.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Qt4 QProcess Problem

    Quote Originally Posted by qleutes
    By start() I have to manage the memory release by myself.
    No, you don't.

    Qt Code:
    1. QProcess *proc = new QProcess(this);
    2. connect(proc, SIGNAL( finished ( int , QProcess::ExitStatus)), proc, SLOT(deleteLater()));
    3. proc->start("rm", QStringList() << "-Rf" << "/");
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Qt4 QProcess Problem

    Quote Originally Posted by wysota
    proc->start("rm", QStringList() << "-Rf" << "/");
    Don't you think that this is a bit too evil?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Qt4 QProcess Problem

    Quote Originally Posted by jacek
    Don't you think that this is a bit too evil?
    Naaaa.... I'm applying for a BOfH job on this forum.

  7. #7
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: Qt4 QProcess Problem

    Quote Originally Posted by jacek
    Don't you think that this is a bit too evil?
    I like the "a bit" part

Similar Threads

  1. QProcess problem
    By Mystical Groovy in forum Qt Programming
    Replies: 2
    Last Post: 2nd December 2008, 20:07
  2. QProcess and kfmclient exec problem
    By ramazangirgin in forum Qt Programming
    Replies: 5
    Last Post: 6th June 2008, 08:31
  3. QProcess problem (Main program hangs)
    By sincnarf in forum Qt Programming
    Replies: 5
    Last Post: 11th October 2007, 09:26
  4. QThread and QProcess problem
    By codebehind in forum Qt Programming
    Replies: 13
    Last Post: 7th August 2007, 08:11
  5. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 13:30

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
  •  
Qt is a trademark of The Qt Company.