本文整理汇总了C++中QProcess::setCommunication方法的典型用法代码示例。如果您正苦于以下问题:C++ QProcess::setCommunication方法的具体用法?C++ QProcess::setCommunication怎么用?C++ QProcess::setCommunication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QProcess
的用法示例。
在下文中一共展示了QProcess::setCommunication方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showHTML
// --------------------------------------------------------------
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()));
}
示例2: editFile
// ------------------------------------------------------------------------
// 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()));
}
示例3: runTask
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;
}
示例4: doDisplay
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
}