Included camera module.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 21 Jun 2017 18:46:17 +0000 (20:46 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 21 Jun 2017 18:46:17 +0000 (20:46 +0200)
qtapp/barcode2cash/barcode2cash.pro
qtapp/barcode2cash/mainwindow.cpp

index 8dc102d3a1548548e90baeb29e999e4f86ea8350..11c90e6365eac252ea88a4c1ec6f3447d82c836f 100644 (file)
@@ -4,7 +4,7 @@
 #
 #-------------------------------------------------
 
-QT       += core gui
+QT       += core gui multimedia
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
index 49d64fce7cedf4ed8c5e0124cfe43e90c23c6ab6..4fe6b38ab6a561cfeed72374e5f0ab6c87b44e3c 100644 (file)
@@ -1,11 +1,22 @@
 #include "mainwindow.h"
 #include "ui_mainwindow.h"
+#include <QCameraInfo>
+
+bool checkCameraAvailability()
+{
+    if (QCameraInfo::availableCameras().count() > 0)
+        return true;
+    else
+        return false;
+}
 
 MainWindow::MainWindow(QWidget *parent) :
     QMainWindow(parent),
     ui(new Ui::MainWindow)
 {
     ui->setupUi(this);
+
+    ui->statusBar->showMessage(tr("There are %1 cameras").arg(checkCameraAvailability()));
 }
 
 MainWindow::~MainWindow()