Re: QProcess' writeToStdin
Quote:
Originally Posted by
Shlainn
When I add
Code:
proc->writeToStdin("1123");
just after the start nothing wants to work :(
Add a newline ("\n") to the string you send.
Re: QProcess' writeToStdin
Ok added the "\n":
Code:
proc->addArgument( username );
proc->addArgument( database );
output->append( (proc->arguments()).join(" "));
proc->start();
proc->writeToStdin("Saurabh\n");
connect( proc, SIGNAL(readyReadStdout()),
this, SLOT(readFromStdout()) );
if ( !proc->start() )
{
But still nothing. Here is the .c code:
Code:
int SetQuery()
{ char query[1024];
char serialnmr[20];
//char *serialnmr;
//serialnmr = "Saurabh";
printf("input");
scanf("%s",serialnmr);
printf("%s\n",serialnmr);
sprintf(query, "SELECT * FROM users WHERE name='%s'",serialnmr);
The .c works in the command line but using QT3 it doesn't want to work.