当前位置: 首页>>代码示例>>C++>>正文


C++ QProcess::setCommunication方法代码示例

本文整理汇总了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()));
}
开发者ID:MikeBrinson,项目名称:qucs,代码行数:16,代码来源:qucs_actions.cpp

示例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()));
}
开发者ID:MikeBrinson,项目名称:qucs,代码行数:19,代码来源:qucs_actions.cpp

示例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;
}
开发者ID:mhdsedighi,项目名称:SOFA,代码行数:22,代码来源:GenGraphForm.cpp

示例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
}
开发者ID:mhdsedighi,项目名称:SOFA,代码行数:24,代码来源:GenGraphForm.cpp


注:本文中的QProcess::setCommunication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。