Video rendering problem with phonon and QGraphicsScene



  • Hello. The following code
    @ QApplication a(argc, argv);
    Phonon::MediaObject *media = new Phonon::MediaObject();
    Phonon::VideoWidget *video = new Phonon::VideoWidget(NULL);
    video->setGeometry(0, 0, 200, 200);
    Phonon::createPath(media, video);
    Phonon::MediaSource source("1.avi");
    media->setCurrentSource(source);
    media->play();
    video->show();
    return a.exec();
    @

    shows me a video. its ok.
    But this:
    @ QApplication a(argc, argv);
    QGraphicsScene scene;
    Phonon::MediaObject *media = new Phonon::MediaObject();
    Phonon::VideoWidget *video = new Phonon::VideoWidget(NULL);
    video->setGeometry(0, 0, 200, 200);
    Phonon::createPath(media, video);
    Phonon::MediaSource source("1.avi");
    media->setCurrentSource(source);
    media->play();
    QGraphicsProxyWidget * pWidget = scene.addWidget(video,Qt::Widget);
    qDebug() << pWidget->size() << pWidget->widget()->size();
    qDebug() << pWidget->pos() << pWidget->widget()->pos();
    qDebug() << pWidget->isVisible() << pWidget->widget()->isVisible();
    QGraphicsView view(&scene);
    view.show();
    return a.exec();
    @

    shows me a widget with white background..and nothing else.. but where is my video ? ;) If i connect audiooutput to media, i hear sound of movie, so stream is going on.
    dump:

    @
    QSizeF(200, 200) QSize(200, 200)
    QPointF(0, 0) QPoint(0,0)
    true true
    @

    Tried with Qt 4.7, Qt 4.8.1.
    My task is to draw some widgets over video in full screen mode, such as playback buttons, seeker and volume slider. If i can do that by another way then using QGraphicsScene tell me please :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.