Results 1 to 2 of 2

Thread: qprocess or qeventloop

  1. #1
    Join Date
    Dec 2009
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Thumbs up qprocess or qeventloop

    given the steps should occur in this order

    a) call external qprocess:start("qconf -sq listL")
    b) the output of this be stored in /tmp/tempfile.txt
    c) this file is modified and saved
    d) call external comm "qconf -Mq /tmp/tempfile.txt"

    how is it possible to use qprocess only to do this. What i have observed is, qprocess will execute the external comm and the control comes back to the next line. this is where the file is being modified. and another qprocess is executed. now this seems fine for a single flow. But when this is to be done in a loop for a list of items (listL), then data in my file is not comprehensive. It comes as though things happened in a hurry ( because of which the second qprocess does not get executed successfully) . So my questions are,

    1) is it possible to create user defined signals ( how ). such that i can call qprocess and trigger a signal ( execute [ step b step c ] ) after this happily execute another qprocess.
    I mean i should have a way to control the flow, only after the file is traversed completely ( step b, step c) will the next qprocess be called.


    alternatively,

    2) will using event handlers ( user defined ) do the same thing as above.

    relatively new to this, i would need an example.

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

    Default Re: qprocess or qeventloop

    Please don't start multiple threads on the same subject.

    http://www.qtcentre.org/forum/f-qt-p...ent-26551.html

    And to answer your question - you can connect to QProcess::finished() signal to trigger the next step of your work.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. [Article] How to QProcess in QThread
    By Raccoon29 in forum Qt Programming
    Replies: 6
    Last Post: 30th November 2009, 08:22
  2. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 12:53
  3. QProcess exitStatus()
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 20:51
  4. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  5. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 00:25

Tags for this Thread

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.