Show a BMP image after a video player



  • Hi all,
    I want play a video on my little application.
    I create a Gui project:
    -> mainwindow.ui with oonly a phonon::Video Player widget
    in mainwindow.cpp this is my code: is all correct?

    @
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <Phonon/VideoPlayer>
    #include <Phonon/MediaObject>
    #include <Phonon/MediaSource>

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    Phonon::MediaObject *media = new Phonon::MediaObject(this);
    media->setCurrentSource(Phonon::MediaSource(QString("/home/Desktop/video.avi")));
    ui->videoPlayer->play(media->currentSource());
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow::changeEvent(QEvent *e)
    {
    QMainWindow::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
    ui->retranslateUi(this);
    break;
    default:
    break;
    }
    }

    void MainWindow::on_videoPlayer_finished()
    {
    //QUANDO FINITO MOSTRARE LA MAPPA!
    }

    @

    How can now show an image .bmp after that video finished?

    why?

    I use Ubuntu 10.04 lts..

    thanks for your help.



  • You connect the signal finished from video player to your slot finished, load image to QPixmap and add it to you graphics view or whatever you have.

    "Signals and slots":http://doc.qt.nokia.com/4.7-snapshot/signalsandslots.html
    And take a look "here":http://qt-project.org/forums/viewthread/13613/, how to display QPixmap on QGraphicsScene

    Regards,
    Jake


Log in to reply
 

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