proc=new QProcess(this); if (proc) { proc->addArgument( "psql" ); proc->addArgument( "-U" ); proc->addArgument( "postgres" ); proc->addArgument( "-d" ); proc->addArgument( "template1" ); proc->addArgument( "-W" ); proc->addArgument( "-f" ); proc->addArgument( qApp->applicationDirPath()+"/del.sql" ); connect( proc, SIGNAL(processExited()), this, SLOT(okDel()) ); connect( proc, SIGNAL(readyReadStderr()), this, SLOT(readFromTest()) ); connect( proc, SIGNAL(readyReadStdout()), this, SLOT(readFromOut()) ); if ( !proc->start() ) { proc->kill(); delete(proc); proc=0; } }