Live & Learn
分类: 嵌入式
2010-09-13 11:54:55
开发和运行环境:/usr/local/Trolltech/Qt-4.6.3/myworks 直接运行程序 ./exp3_0902
/* main.cpp */
#include "player.h"
#include
#include
int main(int argc, char **argv)
{
QApplication app(argc, argv);
player *p = new player(0);
p->show();
return app.exec();
}
/* player.cpp */
#include "player.h"
#include
#include
#include
const QString mplayerPath("/usr/local/bin/mplayer");
const QString movieFile("/home/zhq/Videos/videos_test/ogavi.avi");
player::player(QWidget* parent):QWidget(parent)
{
this->setFixedSize(320+2,240+2);
this->setGeometry(600,600,10,10);
renderTarget=new QWidget(this);
renderTarget->move(1,1);
renderTarget->resize(320,240);
// renderTarget->setAttribute(Qt::WA_PaintOnScreen);
mplayerProcess=new QProcess(this);
QStringList args;
args<<"-slave";
args<<"-quiet";
args<<"-wid"<
args<
}
player::~player()
{
;
}
/* */
#ifndef PLAYER_H
#define PALYER_H
#include
#include
#include
#include
#include
class player:public QWidget
{
Q_OBJECT
public:
player(QWidget* parent=0);
~player();
protected:
protected slots:
//void play();
private:
//QPushButton *playButton;
QWidget *renderTarget;
QProcess *mplayerProcess;
};
#endif