Results 1 to 2 of 2

Thread: To play mplayer in widget

  1. #1

    Default To play mplayer in widget

    Hi to all,
    Please help me, i want a movie to be played in a seprate widget when the user click on an item in a qlistviewitem. When i am using the following code
    QString file="media/" + check;
    QWidget *wd=new QWidget;
    wd->setMinimumSize(QSize(646, 512));
    QString program = "mplayer";
    QStringList arguments;
    arguments << "-wid" << QString::number(wd->winId()) <<file ;
    myProcess= new QProcess;
    myProcess->start(program, arguments);
    wd->show();
    the movie starts playing in the widget before the widget containing the qlistview
    when i am using the code
    QString file="media/" + check;
    QWidget *wd=new QWidget(this};
    wd->setMinimumSize(QSize(646, 512));
    QString program = "mplayer";
    QStringList arguments;
    arguments << "-wid" << QString::number(wd->winId()) <<file ;

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

    movie starts playing in the "this" means parent widget.

    But i want movie to be played in a seprate window at front .

    Please help me .
    Thanking you all

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: To play mplayer in widget

    If you want a widget that is a standalone window, don't pass a pointer to the parent in the constructor. There is another way to obtain the same effect, but you shouldn't need it.

Similar Threads

  1. Drawing a widget in QItemDelegate's paint method
    By darkadept in forum Qt Programming
    Replies: 17
    Last Post: 11th August 2009, 05:15
  2. Replies: 3
    Last Post: 17th October 2007, 12:52
  3. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 17:52
  4. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 14:27
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.