• 3914阅读
  • 0回复

qprocess [复制链接]

上一主题 下一主题
离线nipple
 
只看楼主 倒序阅读 楼主  发表于: 2006-12-11
我是QT新手,我在修改别人的QT程序,想使用Qprocess这个class来呼叫外部程序,我是用QT designer,该如何来呼叫和设置QProcess?请指教!我要用botton来呼叫,按下去就能执行外部程序。
UicManager::UicManager()
  {

    proc = new QProcess( this );

    proc->addArgument( "uic" );
    proc->addArgument( "-tr" );
    proc->addArgument( "i18n" );
    proc->addArgument( "small_dialog.ui" );

    connect( proc, SIGNAL(readyReadStdout()),
          this, SLOT(readFromStdout()) );

    if ( !proc->start() ) {
        // error handling

    }
  }


  void UicManager::readFromStdout()
  {
    // Read and process the data.
    // Bear in mind that the data might be output in chunks.
    这里要如何写?
  }
快速回复
限100 字节
 
上一个 下一个