camera: Single/Double (QtMultimediaCamera)

This commit is contained in:
zhupengfei 2018-06-02 22:13:54 +08:00
parent 3cb91338e9
commit 341c07156a
No known key found for this signature in database
GPG key ID: 85B82A3E62174206
4 changed files with 23 additions and 8 deletions

View file

@ -24,7 +24,7 @@ bool StillImageCamera::IsPreviewAvailable() {
return !image.isNull();
}
const std::string StillImageCameraFactory::getFilePath() {
const std::string StillImageCameraFactory::GetFilePath() {
QList<QByteArray> types = QImageReader::supportedImageFormats();
QList<QString> temp_filters;
for (QByteArray type : types) {
@ -32,7 +32,6 @@ const std::string StillImageCameraFactory::getFilePath() {
}
QString filter = QObject::tr("Supported image files (%1)").arg(temp_filters.join(" "));
return QFileDialog::getOpenFileName(nullptr, QObject::tr("Open File"), ".", filter)
.toStdString();
}
@ -41,7 +40,7 @@ std::unique_ptr<CameraInterface> StillImageCameraFactory::Create(
const std::string& config, const Service::CAM::Flip& flip) const {
std::string real_config = config;
if (config.empty()) {
real_config = getFilePath();
real_config = GetFilePath();
}
QImage image(QString::fromStdString(real_config));
if (image.isNull()) {