[Qt-interest] How to make the Button response quickly?
Kermit Mei
kermit.mei at gmail.com
Sun Mar 1 20:30:02 CET 2009
André Somers wrote:
> Hi,
>
> "Kermit Mei" <kermit.mei at gmail.com> schreef in bericht
> news:49AAAC96.1090601 at gmail.com...
>
>> Hello, When I click the button(a common QPushButton), slot pronounce()
>> will be called. It is defined as the following:
>>
>> void ScannerWidget::pronounce(){
>> QDir wordPath(realPeople.absolutePath().append("/").append(word[0]));
>> qDebug(wordPath.absolutePath().toStdString().c_str());
>> QProcess::execute(playCmd,
>> QStringList(wordPath.absoluteFilePath(word+".wav")));
>> }
>>
>> When the words be pronouncing by another program called by QProcess,
>> the button which I clicked is "down" (I can't clicked it whthin a short
>> time),
>> and it must wait for process, then it can "up".
>>
>> How can I make the pushButton "up" as well as the others ?
>> And, in fact, I just want to pronounce a word when the last haven't
>> finished.
>>
>
> The documentation on QProcess::execute reads:
> "Starts the program program with the arguments arguments in a new process,
> WAITS FOR IT TO FINISH, and then returns the exit code of the process. Any
> data the new process writes to the console is forwarded to the calling
> process." (Caps are mine)
>
> You want to have asynchronous execution. Maybe QProcess::startDetached is
> what you are after?
>
> André
>
>
Thank you, that's just what I wanted;p
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
More information about the Qt-interest-old
mailing list