Play videos on graphicsview.(on Qt5 form graphics view)

  • I am using Qt5 with C++ in Windows7 . Can any one tell how to play videos on form widget (graphicsview).I got the proper out put with QVideowidget.But for my application i need play videos on form . I tryed this code form Qt documentation but i got errors
    player = new QMediaPlayer(this);

    QGraphicsVideoItem *item = new QGraphicsVideoItem;


    Error: graphicsView not declared in this scope.
    if i write in the place of graphic view as ui->graphicsView->scene()->additem(item); , my Qt compiler stop working and suddenly stoped .

  • I had the same problem.
    What I have done is to initialize the scene object.
    QGraphicsScene *scene=new=new QGraphicScene();

Log in to reply