PDA

View Full Version : Play a movie in a widget



Deepak Mishra
30th October 2007, 06:36
Hi to all
I am trying to play a movie in a widget. Code i am using is following



void uploadContents::previewOnDoubleClickSource()
{

if(x11!=0)
{
myProcess->kill();

}

if(x13==1)
DeleteScroller();
Q3ListViewItemIterator it(sourceListView);
for(;it.current();++it)
{

if(it.current()->isSelected())
{

for(QStringList::Iterator it1=listOfFiles.begin();it1!=listOfFiles.end();++i t1)
{
QString file=*it1;
if(QString::compare(file.section("/" ,-1,-1),it.current()->text(0))==0)
{
QWidget *wd=new QWidget;
wd->setMinimumSize(QSize(646, 512));
QString program = "mplayer";
QStringList arguments;
arguments << "-slave" << "-wid" << QString::number(wd->winId()) << "-fs" <<file ;

myProcess = new QProcess(wd);
myProcess->start(program, arguments);

x11=1;
// wd->activateWindow();
// wd->raise();

break;
}

}

}

}
}


I want movie to be played at front but it is playing at back.

When i am creating the widget making this as parent the the parent windows automatically get closed or it plays in the same window i could not understand it.

Plz help me

Thanking you all

wysota
30th October 2007, 09:23
Did you call wd->show() anywhere?

Deepak Mishra
1st November 2007, 07:39
Did you call wd->show() anywhere?

I have used wd->show() but still it's not working. Movie plays but at back(means before a parent widget}. I want it to be played at front.