QVideoWidget inside a GraphicsView



  • Hello,

    I am trying to put a QVideoWidget inside a QGraphicsView but it doesn't work.

    @QMediaPlayer *player = new QMediaPlayer();
    QVideoWidget videoWidget;
    player->setVideoOutput(&videoWidget);
    QGraphicsScene scene;
    QGraphicsProxyWidget *proxy
    = scene.addWidget(&videoWidget);
    QGraphicsView view(&scene);
    player->setMedia(
    QUrl::fromLocalFile("/home/cedric/Vidéos/musique_21sec.mp4"));
    player->play();
    view.show();@
    With that I get only a black window. The sound is playing thought. Anyone know what is wrong? With a QraphicsVideoItem it is working but I don't want to use it since It doesn't allow to change brightness. Outside of a QGraphicsView the QVideoWidget works well.

    Thanks in advance


Log in to reply
 

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