我用qt3.1.1 定义了个qprocess 可用时候出错了
#include "process.h"
#include<qwidget.h>
#include<qprocess.h>
#include<qpushbutton.h>
#include<qstringlist.h>
Process::Process(QWidget *parent):
QWidget(parent),isPlay(false)
{
p=new QProcess(this);
p->setProcessChannelMode(QProcess::MergedChannels);
args<<"-slave"<<"/root/media/f.avi";
button =new QPushButton ("Click", this);
connect(button, SIGNAL( clicked() ), this, SLOT( change()));
p->start("/usr/local/mplayer/bin/mplayer",args);
}
Process::~Process(){}
void Process::change()
{
p->write("pause\n");
isPlay= false;
}
如下错误
process.cpp: In constructor `Process::Process(QWidget*)':
process.cpp:10: `MergedChannels' is not a member of type `QProcess'
process.cpp:14: no matching function for call to `QProcess::start(const
char[31], QStringList&)'
/usr/lib/qt-3.1/include/qprocess.h:77: candidates are: virtual bool
QProcess::start(QStringList* = 0)
process.cpp: In member function `void Process::change()':
process.cpp:19: no matching function for call to `QProcess::write(const char[7]
)'
make: *** [.obj/process.o] Error 1
我想请教一下qt3 下面 QProcess 怎么用啊 write 怎么就错了?