Results 1 to 8 of 8

Thread: Trying to use QProcess

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Trying to use QProcess

    also, you forgot to specify type for function
    Qt Code:
    1. void mainwindow::process_started()
    2. {
    3. process->start("./home/i386-qt-rss");
    4. }
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. #2
    Join Date
    Oct 2009
    Posts
    22
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Trying to use QProcess

    Quote Originally Posted by spirit View Post
    also, you forgot to specify type for function
    Qt Code:
    1. void mainwindow::process_started()
    2. {
    3. process->start("./home/i386-qt-rss");
    4. }
    To copy to clipboard, switch view to plain text mode 
    You know something, I am sitting here looking at some example code and I don't know how I missed that, once you pointed it out I gave my forehead a bloody hard slap.

    Thanks very much.

  3. #3
    Join Date
    Oct 2009
    Posts
    22
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Trying to use QProcess

    Just to add, this has now compiled, however I thought the app the process is linked to would have started and opened up. I can see that there hass been a thread created when I click the pushbutton but nothing appears on screen. Is this normal?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Trying to use QProcess

    if you need call program in a new process use QProcess::startDetached. in this case you will see a separate window.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. The following user says thank you to spirit for this useful post:

    hybrid_snyper (20th October 2009)

  6. #5
    Join Date
    Oct 2009
    Posts
    22
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Trying to use QProcess

    So I take it once startDetached is called then the first application is not aware of the second, ie when the launched app has finished and has been cloased?

  7. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Trying to use QProcess

    it depends on how it works.
    if you need to know when this app will stopped then you should use QProcess::start and handle signals QProcess::started & QProcess::finished.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 13:53
  2. QProcess exitStatus()
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 21:51
  3. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 10th April 2007, 00:11
  4. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 01:25
  5. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 14: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.