Understanding QtMultimediaWidget (solved)



  • What is the relationship between QGraphicsVideoItem, QGraphicsScene, QGraphicView & QmediaPlayer.
    Each time writing one QtMultimediaWidget, all the above class has to be instantiated.
    Thinking understand their relationship aid writing QtMultimediaWidget.

    @

    videoItem = new QGraphicsVideoItem; 
    videoItem->setSize(QSizeF(640, 480));
    QGraphicsScene *scene = new QGraphicsScene(this);
    QGraphicsView *graphicsView = new QGraphicsView(scene);
    scene->addItem(videoItem);
    mediaPlayer.setVideoOutput(videoItem);          //QMediaPlayer mediaPlayer; //in header file
    

    @

    QGraphicsVideoItem is a graphic item which display video
    QGraphicsScene has no visual appearance of its own act and act a container for QGraphicsVideoItem.
    it display individual scene in videoItem from begining till end.
    QGraphicsView is used to visualize the scene.
    QMediaPlayer is a player



  • Great.


Log in to reply
 

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