Results 1 to 5 of 5

Thread: qtconcurrent

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

    Exclamation qtconcurrent

    i have a list of string and want to process it such that


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

    step d should start only after step a b and c have completed.

    I am presuming qtconcurrent::mappedReduced will work. How is it possible to make it work


    "proc->setStandardOutputFile("/tmp/tempfile.txt") is used to set the output"

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

    Default Re: qtconcurrent

    Where does the list of strings kick in exactly? By the way, Qt concurrent is not the tool for the job. QProcess is all you need.
    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.


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

    Thumbs up Re: qtconcurrent

    list of string is gotten using a qprocess::start() the output is saved in a file ( this is working )

    then follows a b c d ( in fact a b c and d are working on single items, however when i go in a loop, i need to do this smoothly for each list item.)

    a) for each item in the list i need to call qprocess::start("qconf -sq item[i]")
    b) store the output in a temp file
    c) modify the file
    d) using this modified file call qprocess::start("qconf -Mq filename")


    Brgds,

    kNish:
    Last edited by knishaq; 15th December 2009 at 08:02. Reason: updated contents

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

    Default Re: qtconcurrent

    Ok, so what is the problem?
    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.


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

    Thumbs up Re: qtconcurrent

    oops. The problem is when i have to do it in a loop. I mean data is written to file abrubtly because of which the step d does not happen.I know, before i ask this question, i should try with Qtemporaryfile class. is there a way to overwrite contents of a file with new. If this is solved then perhaps there is no problem in this context.


    Brgds,

    kNish
    Last edited by knishaq; 15th December 2009 at 08:42. Reason: updated contents

Similar Threads

  1. Replies: 11
    Last Post: 1st February 2018, 04:27
  2. QtConcurrent and CUDA or GPGPU
    By olidem in forum Qt Programming
    Replies: 8
    Last Post: 27th February 2013, 22:07
  3. Simple question about QtConcurrent
    By vcp in forum Qt Programming
    Replies: 6
    Last Post: 15th September 2009, 21:14
  4. QtConcurrent question
    By bair in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2009, 10:46
  5. QtConcurrent Performance
    By tomf in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2008, 15:41

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.