mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
33 lines
653 B
C++
33 lines
653 B
C++
#include "mainwindow.h"
|
|
#include "ui_mainwindow.h"
|
|
|
|
MainWindow::MainWindow ( QWidget* parent ) :
|
|
QMainWindow ( parent ),
|
|
ui ( new Ui::MainWindow )
|
|
{
|
|
ui->setupUi ( this );
|
|
|
|
manager = new QQtV4L2VideoManager ( this );
|
|
connect ( manager, SIGNAL ( readyRead ( QImage ) ), this, SLOT ( slotCaptured ( QImage ) ) );
|
|
}
|
|
|
|
MainWindow::~MainWindow()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
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 );
|
|
}
|