1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| #include <QApplication>
#include <QPushButton>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <QGraphicsScene>
#include <QGraphicsProxyWidget>
#include <QGraphicsView>
#include <QGraphicsVideoItem>
#include <QLabel>
#include <QGridLayout>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *widget = new QWidget;
QMediaPlayer* player = new QMediaPlayer;
QVideoWidget *videoWidget = new QVideoWidget(widget);
player->setVideoOutput(videoWidget);
player->setMedia(QUrl::fromLocalFile("C:/Qt/SAO.mp4"));
videoWidget->setFullScreen(true);
videoWidget->show();
player->play();
QLabel *label2 = new QLabel(widget);
QPixmap pixmap2("C:/Connection.png");
label2->setPixmap(pixmap2);
//label->resize(pixmap.size());
widget->show();
return a.exec();
} |
Partager