[Qt-interest] Error encountered while using void setStandardOutputProcess ( QProcess * destination )
Usman Ajmal
uzmanajmal at gmail.com
Thu Jul 23 08:50:09 CEST 2009
Sorry friends...for replying so late.
I used the following code and it worked.
void MainWindow::sendImage()
{
QObject *parent;
QString command1 = "dd if=/dev/mem";
QString command2 = "netcat";
QStringList arguments;
arguments<<lineEdit_ipAddr->text()<<"9001";
QProcess *process1 = new QProcess(parent);
QProcess *process2 = new QProcess(parent);
process1->setStandardOutputProcess(process2);
process1->start(command1);
process2->start(command2, arguments);
QTextStream cout(stdout);
}
Thanks to Chandru for letting me know the use of QStringlist for arguments.
Thanks to Thiago for identifying the small tiny space before the last
quotation mark in "netcat ". Thanks to all other who helped
On Wed, Jul 22, 2009 at 4:54 PM, John McClurkin <jwm at nei.nih.gov> wrote:
> Srdjan Todorovic wrote:
> > Hi,
> >
> > On 22/07/2009, Thiago Macieira <thiago.macieira at trolltech.com> wrote:
> >
> >> QString command1 = "dd if=/dev/mem";
> >> QString command2 = "netcat ";
> >>
> >> I doubt you have a command called "netcat ".
> >
> > Actually a number of systems do have "netcat", if only as a symlink:
> >
> > lrwxrwxrwx 1 root root 2 2007-05-21 10:04 /bin/netcat -> nc
> Systems do have a command "netcat" but not "netcat ". Note the space at
> the end of the second form of the command.
> _______________________________________________
> 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/20090723/8f05a446/attachment.html
More information about the Qt-interest-old
mailing list