8.1.5 捕获图像到文件示例(实现照相机功能)
(配套代码CH8-2)
1. QCamera.pro文件代码
#-------------------------------------------------
#
# Project created by QtCreator 2018-05-30T18:02:49
#
#-------------------------------------------------
QT += core gui
QT += multimediawidgets
QT += xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = QCamera
TEMPLATE = app
SOURCES += main.cpp\
widget.cpp
HEADERS += widget.h
FORMS += widget.ui
2. widget.h文件代码
#ifndef WIDGET_H
#define WIDGET_H
#include
#include
#include
#include
#include
namespace Ui {
class Widget;
}
class Widget : public QWidg