hi friends,
please help :(
i create a code to embed gtk window to my Qt app ..
mainwindow.cpp
Code:
connect(procc2, SIGNAL(readyReadStandardOutput()), this, SLOT(readFromStdout2()));
this is a timer function calling every 400 milli sec
Code:
MainWindow::timeout{ if(...) { QStringList arguments2; { procc2->start(program4, arguments2); } }
readfromstdout() function will call the function to embed the process
Code:
MainWindow::readFromStdout2() { int j = 0; bool ok; QString out; printf("in singal fin\n"); out = procc2->readAllStandardOutput(); j = out.toInt(&ok, 16); printf("j =%d\n",j); if(j == 1) printf("device not connected\n"); else{ printf("the device connected\n"); embed(); } }
this is my code and the function embed() will embed the "gtk_demo" window if it returns 0 or anything ...
the problem is on first time if i spawn the signal "readyReadStandardOutput()"
is not emitted and readFromStdout2() slot is not called .
i closed the spawned gtk application "gtk_demo" and as i put the procc in loop again it spawn "gtk_demo" its emitting "readyReadStandardOutput()" and embedding perfectly ... why??:confused:
i changed gtk application to a Qt application and try the same thing its worked in the first attempt ... :confused:
please help me ...