mirror of
https://github.com/brmlab/microview.git
synced 2025-06-07 11:04:35 +02:00
add more functionality
This commit is contained in:
parent
338dee788a
commit
acfcfd997b
6 changed files with 95 additions and 6 deletions
|
@ -1,8 +1,10 @@
|
|||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "microview.h"
|
||||
#include <gst/gst.h>
|
||||
#include <gst/interfaces/xoverlay.h>
|
||||
#include <QMessageBox>
|
||||
#include <qdebug.h>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
|
@ -43,3 +45,65 @@ void MainWindow::on_pushAbout_clicked()
|
|||
aboutBox.setIconPixmap(QPixmap(":/icons/icon.png"));
|
||||
aboutBox.exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_pushL_clicked()
|
||||
{
|
||||
qDebug() << MSG_LEFT;
|
||||
}
|
||||
|
||||
void MainWindow::on_pushR_clicked()
|
||||
{
|
||||
qDebug() << MSG_RIGHT;
|
||||
}
|
||||
|
||||
void MainWindow::on_pushU_clicked()
|
||||
{
|
||||
qDebug() << MSG_UP;
|
||||
}
|
||||
|
||||
void MainWindow::on_pushD_clicked()
|
||||
{
|
||||
qDebug() << MSG_DOWN;
|
||||
}
|
||||
|
||||
void MainWindow::on_pushZoomIn_clicked()
|
||||
{
|
||||
qDebug() << MSG_PLUS;
|
||||
}
|
||||
|
||||
void MainWindow::on_pushZoomOut_clicked()
|
||||
{
|
||||
qDebug() << MSG_MINUS;
|
||||
}
|
||||
|
||||
void MainWindow::on_pushSnap_clicked()
|
||||
{
|
||||
qDebug() << MSG_SNAP;
|
||||
}
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
switch (e->key()) {
|
||||
case Qt::Key_A:
|
||||
on_pushL_clicked();
|
||||
break;
|
||||
case Qt::Key_S:
|
||||
on_pushD_clicked();
|
||||
break;
|
||||
case Qt::Key_D:
|
||||
on_pushR_clicked();
|
||||
break;
|
||||
case Qt::Key_W:
|
||||
on_pushU_clicked();
|
||||
break;
|
||||
case Qt::Key_O:
|
||||
on_pushZoomIn_clicked();
|
||||
break;
|
||||
case Qt::Key_L:
|
||||
on_pushZoomOut_clicked();
|
||||
break;
|
||||
case Qt::Key_Y:
|
||||
on_pushSnap_clicked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,14 @@ private slots:
|
|||
|
||||
void on_pushExit_clicked();
|
||||
void on_pushAbout_clicked();
|
||||
void on_pushL_clicked();
|
||||
void on_pushR_clicked();
|
||||
void on_pushU_clicked();
|
||||
void on_pushD_clicked();
|
||||
void on_pushZoomIn_clicked();
|
||||
void on_pushZoomOut_clicked();
|
||||
void on_pushSnap_clicked();
|
||||
void keyPressEvent(QKeyEvent *e);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<widget class="QPushButton" name="pushZoomIn">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>660</x>
|
||||
<x>740</x>
|
||||
<y>160</y>
|
||||
<width>51</width>
|
||||
<height>31</height>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<widget class="QPushButton" name="pushZoomOut">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>740</x>
|
||||
<x>660</x>
|
||||
<y>160</y>
|
||||
<width>51</width>
|
||||
<height>31</height>
|
||||
|
|
12
software/microview.h
Normal file
12
software/microview.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef MICROVIEW_H
|
||||
#define MICROVIEW_H
|
||||
|
||||
#define MSG_LEFT "X-10"
|
||||
#define MSG_RIGHT "X+10"
|
||||
#define MSG_UP "Y-10"
|
||||
#define MSG_DOWN "Y+10"
|
||||
#define MSG_MINUS "Z-10"
|
||||
#define MSG_PLUS "Z+10"
|
||||
#define MSG_SNAP "SNAP"
|
||||
|
||||
#endif // MICROVIEW_H
|
|
@ -15,7 +15,8 @@ SOURCES += main.cpp\
|
|||
videoview.cpp
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
videoview.h
|
||||
videoview.h \
|
||||
microview.h
|
||||
|
||||
FORMS += mainwindow.ui
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "videoview.h"
|
||||
#include "microview.h"
|
||||
#include <qdebug.h>
|
||||
|
||||
VideoView::VideoView(QWidget *parent) :
|
||||
|
@ -8,12 +9,15 @@ VideoView::VideoView(QWidget *parent) :
|
|||
|
||||
void VideoView::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
// TODO: process position
|
||||
qDebug() << event->pos();
|
||||
}
|
||||
|
||||
void VideoView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
// TODO: process delta
|
||||
qDebug() << event->delta();
|
||||
if (event->delta() > 0) {
|
||||
qDebug() << MSG_PLUS;
|
||||
} else
|
||||
if (event->delta() < 0) {
|
||||
qDebug() << MSG_MINUS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue