请问LZ,我这样写但是运行后点击PLAY,会蹦出一个SDL窗口,视频在这个窗口里播放,之前那个QT窗口鼠标点击没有反应了,当关闭SDL窗口,QT窗口也关闭了,这是怎么回事呀?
DEMO::DEMO(QWidget *parent) :
QWidget(parent)
//ui(new Ui::DEMO)
{
// ui->setupUi(this);
setWindowTitle("Media Player");
resize(400,400);
mediaObject = new Phonon::MediaObject(this);
videoWidget = new Phonon::VideoWidget(this);
/*set sdl env*/
char variable[64];
#ifdef Q_OS_WIN
sprintf(variable, "SDL_WINDOWID=0x%lx", videoWidget->winId());
#else
sprintf(variable, "SDL_WINDOWID=0x%lx", this->winId());
#endif
printf("SDL_WINDOWID = %s \n",variable);
SDL_putenv(variable);
/* char variable[64];
sprintf(variable, "SDL_WINDOWID=0x%lx",QWidget::winId());
putenv(variable);*/
videoWidget->setAspectRatio(Phonon::VideoWidget::AspectRatioAuto);
// videoWidget->setScaleMode(Phonon::VideoWidget::ScaleAndCrop);
//videoWidget->setAttribute(QT::WA_PaintOnScreen);
//videoWidget->setAttribute(QT::WA_NoSystemBackground);
videoWidget->show();
Phonon::createPath(mediaObject, videoWidget);
audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory);
Phonon::createPath(mediaObject, audioOutput);
QLabel *label = new QLabel("Volume:");
volumeSlider = new Phonon::VolumeSlider;请楼主