[Qt-interest] newbie: application locks up
chandrasekar wagmare
sekarwagmare at gmail.com
Fri May 1 11:47:57 CEST 2009
use this two signals in QProcess() :
void readyReadStandardOutput(); //when a stdoutput is available
void readyReadStandardError(); //when a stderror is available
and use QByteArray readAllStandardOutput(); and readAllStandardError() ; to
read the std output or error of the external process in a QString and
display it in the box;
ay 1, 2009 at 1:19 PM, john doe <thebiggestbangtheory at gmail.com> wrote:
>
>
> On Fri, May 1, 2009 at 12:46 AM, chandrasekar wagmare <
> sekarwagmare at gmail.com> wrote:
>
>>
>> u have two ways, invoking an external program using QProcess()
>> and if u dont want the gui part freeze use QThread() .
>>
>
> awesome! I will look them up.. and since we are on the topic how can I set
> up a 2-way communication with the external program to display any error msgs
> in a text box or something?
>
> Thanks again
>
>
>> On Fri, May 1, 2009 at 1:08 PM, john doe <thebiggestbangtheory at gmail.com>wrote:
>>
>>> Hello all,
>>> Still relative newbie with Qt. I have made my first form
>>> containing combo buttons, lineedits and whatnot :-). I am facing a problem
>>> though regarding calling an external program from within the C++ Qt code.
>>>
>>> I have a ubuntu system and want to invoke a shell script which does some
>>> string manipulations on a large file. I used system() within the C++ code to
>>> do it and it runs. The problem is that when I press a button to start the
>>> external program, if it takes 10 minutes to finish, the button seems to be
>>> depressed for this duraion. Basically, like waiting for the program to
>>> finish. How can I make the button not be depressed for this complete
>>> duration so that I can possibly start another instance of the external
>>> program by pressing a button on the main form.
>>>
>>> I am not an expert programmer, but I think this smells of asynchronous
>>> calls..right? Any insight would be greatly appreciated :-).
>>>
>>> I did try using a & at the end of the external program I am invoking but
>>> that does not help. Nothing runs. I am using kdesudo to start the external
>>> program as it requires certain privileges.
>>>
>>> Also I tried to use a progress bar with minimum and max set to 0 to
>>> continuosly work while the external program is running and it does not seem
>>> to work. Any pointers to threads/articles?
>>>
>>> Thanks in advance.
>>>
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>
>>>
>>
>>
>> --
>> WAGMARE
>>
>
>
--
WAGMARE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090501/c5b06e9b/attachment.html
More information about the Qt-interest-old
mailing list