mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-20 05:39:59 +01:00
Working on the menus
This commit is contained in:
@@ -14,6 +14,7 @@ void custom_filter(cv::Mat &frame) {
|
|||||||
AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
|
AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||||
generate_map();
|
generate_map();
|
||||||
setGeometry(0, 0, 800, 600);
|
setGeometry(0, 0, 800, 600);
|
||||||
|
setFixedSize(800, 600);
|
||||||
setWindowTitle("Acid Cam v2 - Qt");
|
setWindowTitle("Acid Cam v2 - Qt");
|
||||||
createControls();
|
createControls();
|
||||||
createMenu();
|
createMenu();
|
||||||
@@ -76,11 +77,53 @@ void AC_MainWindow::createControls() {
|
|||||||
|
|
||||||
void AC_MainWindow::createMenu() {
|
void AC_MainWindow::createMenu() {
|
||||||
|
|
||||||
|
|
||||||
|
file_menu = menuBar()->addMenu(tr("&File"));
|
||||||
|
controls_menu = menuBar()->addMenu(tr("&Controls"));
|
||||||
|
help_menu = menuBar()->addMenu(tr("Help"));
|
||||||
|
|
||||||
|
file_new_capture = new QAction(tr("Capture from Webcam"),this);
|
||||||
|
file_new_capture->setShortcut(tr("Ctrl+N"));
|
||||||
|
file_menu->addAction(file_new_capture);
|
||||||
|
|
||||||
|
file_new_video = new QAction(tr("Capture from Video"), this);
|
||||||
|
file_new_video->setShortcut(tr("Ctrl+V"));
|
||||||
|
file_menu->addAction(file_new_video);
|
||||||
|
|
||||||
|
file_exit = new QAction(tr("E&xit"), this);
|
||||||
|
file_exit->setShortcut(tr("Ctrl+X"));
|
||||||
|
file_menu->addAction(file_exit);
|
||||||
|
|
||||||
|
connect(file_new_capture, SIGNAL(triggered()), this, SLOT(file_NewCamera()));
|
||||||
|
connect(file_new_video, SIGNAL(triggered()), this, SLOT(file_NewVideo()));
|
||||||
|
connect(file_exit, SIGNAL(triggered()), this, SLOT(file_Exit()));
|
||||||
|
|
||||||
|
controls_snapshot = new QAction(tr("&Snap"), this);
|
||||||
|
controls_snapshot->setShortcut(tr("Ctrl+S"));
|
||||||
|
controls_menu->addAction(controls_snapshot);
|
||||||
|
|
||||||
|
controls_pause = new QAction(tr("&Pause"), this);
|
||||||
|
controls_pause->setShortcut(tr("Ctrl+P"));
|
||||||
|
controls_menu->addAction(controls_pause);
|
||||||
|
|
||||||
|
controls_step = new QAction(tr("Step"), this);
|
||||||
|
controls_step->setShortcut(tr("Controls+I"));
|
||||||
|
controls_menu->addAction(controls_step);
|
||||||
|
|
||||||
|
connect(controls_snapshot, SIGNAL(triggered()), this, SLOT(controls_Snap()));
|
||||||
|
connect(controls_pause, SIGNAL(triggered()), this, SLOT(controls_Pause()));
|
||||||
|
connect(controls_step, SIGNAL(triggered()), this, SLOT(controls_Step()));
|
||||||
|
|
||||||
|
help_about = new QAction(tr("Help"), this);
|
||||||
|
help_about->setShortcut(tr("Ctrl+A"));
|
||||||
|
help_menu->addAction(help_about);
|
||||||
|
|
||||||
|
connect(help_about, SIGNAL(triggered()), this, SLOT(help_About()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AC_MainWindow::addClicked() {
|
void AC_MainWindow::addClicked() {
|
||||||
|
|
||||||
|
|
||||||
int row = filters->currentRow();
|
int row = filters->currentRow();
|
||||||
if(row != -1) {
|
if(row != -1) {
|
||||||
custom_filters->addItem(ac::draw_strings[row].c_str());
|
custom_filters->addItem(ac::draw_strings[row].c_str());
|
||||||
@@ -125,5 +168,31 @@ void AC_MainWindow::Log(const QString &s) {
|
|||||||
log_text->setTextCursor(tmpCursor);
|
log_text->setTextCursor(tmpCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::file_Exit() {
|
||||||
|
QApplication::exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::file_NewVideo() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::file_NewCamera() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::controls_Snap() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::controls_Pause() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::controls_Step() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::help_About() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,20 +7,30 @@ class AC_MainWindow : public QMainWindow {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AC_MainWindow(QWidget *parent = 0);
|
AC_MainWindow(QWidget *parent = 0);
|
||||||
|
void Log(const QString &s);
|
||||||
|
|
||||||
QListWidget *filters, *custom_filters;
|
QListWidget *filters, *custom_filters;
|
||||||
QPushButton *btn_add, *btn_remove, *btn_moveup, *btn_movedown;
|
QPushButton *btn_add, *btn_remove, *btn_moveup, *btn_movedown;
|
||||||
QTextEdit *log_text;
|
QTextEdit *log_text;
|
||||||
QCheckBox *chk_negate;
|
QCheckBox *chk_negate;
|
||||||
QComboBox *combo_rgb;
|
QComboBox *combo_rgb;
|
||||||
|
QMenu *file_menu, *controls_menu, *help_menu;
|
||||||
|
QAction *file_exit, *file_new_capture, *file_new_video;
|
||||||
|
QAction *controls_snapshot, *controls_pause, *controls_step;
|
||||||
|
QAction *help_about;
|
||||||
public slots:
|
public slots:
|
||||||
void addClicked();
|
void addClicked();
|
||||||
void rmvClicked();
|
void rmvClicked();
|
||||||
void upClicked();
|
void upClicked();
|
||||||
void downClicked();
|
void downClicked();
|
||||||
|
void file_Exit();
|
||||||
|
void file_NewVideo();
|
||||||
|
void file_NewCamera();
|
||||||
|
void controls_Snap();
|
||||||
|
void controls_Pause();
|
||||||
|
void controls_Step();
|
||||||
|
void help_About();
|
||||||
|
|
||||||
void Log(const QString &s);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createControls();
|
void createControls();
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
#include<QTextCursor>
|
#include<QTextCursor>
|
||||||
#include<QComboBox>
|
#include<QComboBox>
|
||||||
#include<QCheckBox>
|
#include<QCheckBox>
|
||||||
|
#include<QMenu>
|
||||||
|
#include<QMenuBar>
|
||||||
|
#include<QAction>
|
||||||
#include"ac.h"
|
#include"ac.h"
|
||||||
#include"fractal.h"
|
#include"fractal.h"
|
||||||
#include<unordered_map>
|
#include<unordered_map>
|
||||||
|
|||||||
Reference in New Issue
Block a user