Go to the documentation of this file.00001
00003 #include <QApplication>
00004 #include <QPushButton>
00005 #include <QHBoxLayout>
00006 #include <QVBoxLayout>
00007 #include <QSlider>
00008
00009 #include "OverlayWidget.h"
00010
00011 #include "CameraThread.h"
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 int main(int argc, char **argv) {
00022 QApplication app(argc, argv);
00023
00024
00025 QWidget *window = new QWidget;
00026 QHBoxLayout *layout = new QHBoxLayout;
00027 layout->setContentsMargins(0, 0, 0, 0);
00028
00029
00030 QSlider *slider = new QSlider(Qt::Vertical);
00031 layout->addWidget(slider);
00032
00033
00034 OverlayWidget *overlay = new OverlayWidget(window);
00035 overlay->setFixedSize(640, 480);
00036 layout->addWidget(overlay);
00037
00038
00039 QVBoxLayout *buttonLayout = new QVBoxLayout;
00040 layout->addLayout(buttonLayout);
00041 QPushButton *quitButton = new QPushButton("X");
00042 QPushButton *button1 = new QPushButton("1");
00043 QPushButton *button2 = new QPushButton("2");
00044 QPushButton *button3 = new QPushButton("3");
00045 quitButton->setFixedSize(80, 64);
00046 button1->setFixedSize(80, 64);
00047 button2->setFixedSize(80, 64);
00048 button3->setFixedSize(80, 64);
00049 buttonLayout->addWidget(quitButton);
00050 buttonLayout->addStretch(1);
00051 buttonLayout->addWidget(button1);
00052 buttonLayout->addWidget(button2);
00053 buttonLayout->addWidget(button3);
00054
00055 window->setLayout(layout);
00056
00057
00058 CameraThread cameraThread(overlay);
00059
00060
00061 QObject::connect(quitButton, SIGNAL(clicked()),
00062 &cameraThread, SLOT(stop()));
00063
00064
00065 QObject::connect(&cameraThread, SIGNAL(finished()),
00066 &app, SLOT(quit()));
00067
00068
00069
00070 window->showFullScreen();
00071
00072
00073 cameraThread.start();
00074
00075
00076 return app.exec();
00077 }