Show a BMP image
Hi all,
I’m making a program to display a bmp image after a video ends ..
I wrote this code:
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- #include <Phonon/VideoPlayer>
- #include <Phonon/MediaObject>
- #include <Phonon/MediaSource>
- #include <QString>
- #include <QImageReader>
- #include <QImage>
- #include <QGraphicsScene>
- #include <QGraphicsView>
- #include <QGraphicsPixmapItem>
- #include <QLabel>
- ui(new Ui::MainWindow)
- {
- ui->setupUi(this);
- Phonon::MediaObject *media = new Phonon::MediaObject(this);
- ui->videoPlayer->play(media->currentSource());
- }
- MainWindow::~MainWindow()
- {
- delete ui;
- }
- {
- switch (e->type()) {
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
- }
- void MainWindow::on_videoPlayer_finished()
- {
- ui->videoPlayer->close();
- QGraphicsScene scene;
- scene.addItem(&item);
- view.show();
- }
At finished i not view BMP image..
You can help me, please?
thanks at all
2 replies
You didn’t position(and/or layout) your QGraphicsView in your central widget.
But, it seems to me even if you do that, the design would look bad in this case.
Though I did’t have any experience with phonon videoplayer widget class, it should be able to show any simple image file to its display or at least you can derive your own videoplayer class from it, and override QWidget::paintEvent() to show your image whenever you want.
You must log in to post a reply. Not a member yet? Register here!
