[Qt-interest] qprocess related with qprogressbar

mierdatutis mi mmm286 at gmail.com
Thu Jun 25 23:26:58 CEST 2009


Many thanks to all.

I will try to capture the stdout of the shell script and parse it in order
to update the progress bar.

I see that for I capture the stdout I have to use the signal
"readyReadStandardOutput"


I declare a Qprocess in the funciton MainWindow but when I try to compile it
gives me an error when I do:

proc2->start("/home/david/seguridad/verdadero/pruebon.sh", QStringList() <<
strs );


in other function that it's a slot of a ListWidget Signal. The compiler says
me:
src/mawindindowimpl.cpp:87:error: 'proc2' not declared in this scope


I must declare : QProcess *proc2 = new QProcess(); in all functions???

Many thanks and sorry for my english!






2009/6/25 Sean Harmer <sean.harmer at maps-technology.com>

> Hi,
>
> On Thursday 25 Jun 2009 10:33:24 mierdatutis mi wrote:
> > Hi,
> >
> > I have a QProcess that execute a shell script to get some datas. The
> > process take about a minute or two minutes.
> >
> > How I don't know the time exactly that the shells-cript is long I have a
> > Qprogressbar that have a 2 minutes counter.
> >
> > I would like if there is a way to can relate the qprogressbar with the
> > qprocess for the qprogressbar shows exactly the qprocess lenght.
> >
> > Many thanks and sorry for my english!
> You could modify your shell script to output some progress info (if it
> doesn't
> already) to stdout or stderr and get your app to read in this output and
> parse
> it in order to update the progress bar with real progress info rather than
> just guessing.
>
> Sean
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090625/e2c2a9d2/attachment.html 


More information about the Qt-interest-old mailing list