1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/videotest5/mainwindow.cpp

33 lines
653 B
C++
Raw Normal View History

#include "mainwindow.h"
#include "ui_mainwindow.h"
2019-09-08 09:15:01 +08:00
MainWindow::MainWindow ( QWidget* parent ) :
QMainWindow ( parent ),
ui ( new Ui::MainWindow )
{
2019-09-08 09:15:01 +08:00
ui->setupUi ( this );
manager = new QQtV4L2VideoManager ( this );
connect ( manager, SIGNAL ( readyRead ( QImage ) ), this, SLOT ( slotCaptured ( QImage ) ) );
}
MainWindow::~MainWindow()
{
delete ui;
}
2019-09-08 09:15:01 +08:00
void MainWindow::on_pushButton_clicked()
{
manager->startCapture();
}
void MainWindow::on_pushButton_2_clicked()
{
manager->stopCapture();
}
void MainWindow::slotCaptured ( const QImage& img )
{
ui->widget->setPixmap ( img );
}