[Qt-interest] Embedding video in QGraphicsView

Parta lists4pghanghas at gmail.com
Tue Nov 17 11:13:01 CET 2009


Hi


I am having problem embedding video in QGraphicsView with qt4.5.
After some fruitless efforts with  4.5 I downloaded 4.6  preview  and
the same code works fine.

with 4.5 I even tried the code provided in this post
http://labs.trolltech.com/blogs/2008/11/28/videos-get-pimped/
but it didnt work. Surprisingly even this one works with 4.6. I even
tried the embedding the mediaplayer provided in qtdemos like this

    #include "mediaplayer.h"

    #include <QtGui>

    int main(int argc, char *argv[])

    {

    Q_INIT_RESOURCE(mediaplayer);

    QApplication app(argc, argv);

    QGraphicsScene scene(10,10,600,600);

    QGraphicsView view(&scene);

    view.setGeometry(0,0,800,600);

    MediaPlayer *player = new
    MediaPlayer(QString("/home/user/Desktop/meet.ogv"));

    QGraphicsProxyWidget *embedded_player = scene.addWidget(player);

    view.show();

    return app.exec();

    }

This also works fine in 4.6 but plays only audio in 4.5.
All this works fine with 4.5 if I use them in a QWidget or any other
mainWindow ( I mean when I dont embed it into a
QGV).

--
Regards,
Parta



More information about the Qt-interest-old mailing list