Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Problem Regarding Data reading from QProcess::readAll

$
0
0
hai, In my application, i am using combo box. In that combo box 8 channels will be their. So when we select a channel1 Qprocess will run C executable file and i will read data from that process. I am using this type of code for running the C code after selecting a channel.         program = "/home/Testing/test";         arguments<<"0xff"<<"0xbb"<<"0xcc"<<"0xdd"<<"0xaa"<<"0xcd"<<"0xab"<<"0xdf";                 process =new QProcess(this);         process->setReadChannel(QProcess::StandardOutput);         process->start(program,arguments);         process->waitForFinished();        QByteArray  b1=process->readAllStandardOutput();         ui1->textEdit->clear();         QString command(b1);         ui1->textEdit->setText(command);         process->closeReadChannel(QProcess::StandardOutput);         process->kill();         b1.clear();     My problem is when i select channel1, channel 1 data is displayed in text edit. If i select channel 2, then both channel 1 and channel 2 is displaying. i.e., QByteArray b1=process->readAllStandardOutput(); this function is reading both previous and present channel data. But i need only selected channel data. So how can i clear the previous channel data. Its very important to me. So please give your valuable suggestions for this post. Thank you…..

Viewing all articles
Browse latest Browse all 13965

Trending Articles