Place viewfinder widget into main window.
[toast/barcode2cash.git] / qtapp / barcode2cash / mainwindow.cpp
index fdc6847109b725be78d939d5b864fbd775ead56f..800836dd52fcee504ef37e427731ab77da69b570 100644 (file)
@@ -19,9 +19,7 @@ MainWindow::MainWindow(QWidget *parent) :
     if (!info.isNull()) {
         camera = new QCamera(info);
         camera->setCaptureMode(QCamera::CaptureStillImage);
-        viewfinder = new QCameraViewfinder;
-        camera->setViewfinder(viewfinder);
-        viewfinder->show();
+        camera->setViewfinder(ui->viewFinder);
         imageCapture = new QCameraImageCapture(camera);
         connect(imageCapture, SIGNAL(readyForCaptureChanged(bool)), SLOT(updateCameraInfo()));
         connect(imageCapture, SIGNAL(imageSaved(int,QString)), SLOT(showCaptureSuccess(int,QString)));
@@ -38,7 +36,6 @@ MainWindow::MainWindow(QWidget *parent) :
 
 MainWindow::~MainWindow() {
     delete imageCapture;
-    delete viewfinder;
     delete camera;
     delete ui;
 }