// -------------------------------------------------------------- void QucsApp::showHTML(const QString& Page) { QStringList com; com << QucsSettings.BinDir + "qucshelp" << Page; QProcess *QucsHelp = new QProcess(com); QucsHelp->setCommunication(0); if(!QucsHelp->start()) { QMessageBox::critical(this, tr("Error"), tr("Cannot start qucshelp!")); delete QucsHelp; return; } // to kill it before qucs ends connect(this, SIGNAL(signalKillEmAll()), QucsHelp, SLOT(kill())); }
// ------------------------------------------------------------------------ // Is called by slotShowLastMsg(), by slotShowLastNetlist() and from the // component edit dialog. void QucsApp::editFile(const QString& File) { QStringList com; com << QucsSettings.Editor; if (!File.isEmpty()) com << File; QProcess *QucsEditor = new QProcess(com); QucsEditor->setCommunication(0); if(!QucsEditor->start()) { QMessageBox::critical(this, tr("Error"), tr("Cannot start text editor!")); delete QucsEditor; return; } // to kill it before qucs ends connect(this, SIGNAL(signalKillEmAll()), QucsEditor, SLOT(kill())); }
void GenGraphForm::runTask() { QStringList argv = tasks.front(); tasks.pop_front(); exportButton->setText("&Kill"); QString cmd = argv.join(QString(" ")); std::cout << "STARTING TASK " << (const char*)cmd << std::endl; #ifdef SOFA_QT4 QProcess* p = new QProcess(this); QString program = argv.front(); argv.pop_front(); p->setReadChannelMode(QProcess::ForwardedChannels); connect(p,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(taskFinished())); p->start(program, argv); #else QProcess* p = new QProcess(argv, this); p->setCommunication(0); connect(p,SIGNAL(processExited()),this,SLOT(taskFinished())); p->start(); #endif currentTask = p; }
void GenGraphForm::doDisplay() { if (exportedFile==QString("")) return; std::cout << "OPEN " << (const char*)exportedFile << std::endl; #ifdef WIN32 ShellExecuteA(NULL, "open", exportedFile, NULL, NULL, SW_SHOWNORMAL); #else QStringList argv; argv << "display" << exportedFile; #ifdef SOFA_QT4 QString program = argv.front(); argv.pop_front(); //QProcess::startDetached(program, argv); //QString("start \"\"\"")+exportedFile+QString("\"\"\"")); QProcess::startDetached(program, argv); //QString("start \"\"\"")+exportedFile+QString("\"\"\"")); #else QProcess* p = new QProcess(argv, this); p->setCommunication(0); connect(p,SIGNAL(processExited()),p,SLOT(deleteLater())); p->start(); #endif #endif }