Skip to content

Commit

Permalink
Camera combo box
Browse files Browse the repository at this point in the history
  • Loading branch information
zaak committed Dec 21, 2017
1 parent 33945f0 commit b3cde0f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CamGrab.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.5.0, 2017-12-21T17:25:34. -->
<!-- Written by QtCreator 4.5.0, 2017-12-21T18:39:49. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
14 changes: 9 additions & 5 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ MainWindow::MainWindow(QWidget *parent) :
ui(new Ui::MainWindow)
{
ui->setupUi(this);
Console::setOutputControl(ui->consoleOutput);

ui->consoleDockWidget->setVisible(false);
QWidget *horizontalSpacer = new QWidget();
horizontalSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
ui->mainToolBar->addWidget(horizontalSpacer);

Console::setOutputControl(ui->consoleOutput);
ui->mainToolBar->addWidget(new QComboBox());

ui->consoleDockWidget->setVisible(false);
}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::startCamera(bool a)
void MainWindow::startCamera(bool enable)
{
QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
qDebug() << cameras.size();

foreach (const QCameraInfo &cameraInfo, cameras) {

qDebug() << cameraInfo.deviceName();
Expand All @@ -37,4 +42,3 @@ void MainWindow::startCamera(bool a)
ui->statusBar->showMessage("Aaaaa");
}
}

2 changes: 2 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <QCamera>
#include <QCameraInfo>
#include <QCameraViewfinder>
#include <QComboBox>
#include <QSpacerItem>

namespace Ui {
class MainWindow;
Expand Down
3 changes: 2 additions & 1 deletion mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(46, 52, 54);</string>
<string notr="true">background-color: rgb(46, 52, 54);
color: rgb(255, 255, 255);</string>
</property>
<property name="readOnly">
<bool>true</bool>
Expand Down

0 comments on commit b3cde0f

Please sign in to comment.