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