diff --git a/src/ui/SlugsVideoCamControl.cpp b/src/ui/SlugsVideoCamControl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1729aeb9f0f1a5df0c661a5a5f6392284a867740 --- /dev/null +++ b/src/ui/SlugsVideoCamControl.cpp @@ -0,0 +1,58 @@ +#include "SlugsVideoCamControl.h" +#include "ui_SlugsVideoCamControl.h" + +#include +#include +#include +#include +#include +#include +#include + + +SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) : + ui(new Ui::SlugsVideoCamControl) +{ + ui->setupUi(this); + +// QGraphicsScene *scene = new QGraphicsScene(ui->CamControlPanel_graphicsView); +// scene->setItemIndexMethod(QGraphicsScene::NoIndex); +// scene->setSceneRect(-200, -200, 400, 400); +// setScene(scene); +// setCacheMode(CacheBackground); +// setViewportUpdateMode(BoundingRectViewportUpdate); +// setRenderHint(QPainter::Antialiasing); +// setTransformationAnchor(AnchorUnderMouse); +// setResizeAnchor(AnchorViewCenter); + + ui->CamControlPanel_graphicsView->installEventFilter(this); + ui->label_x->installEventFilter(this); + +} + +SlugsVideoCamControl::~SlugsVideoCamControl() +{ + delete ui; +} + +void SlugsVideoCamControl::mouseMoveEvent(QMouseEvent *event) +{ + ui->label_x->setText(QString::number(event->x())); + ui->label_y->setText(QString::number(event->y())); +} + + +//void SlugsVideoCamControl::mousePressEvent(QMouseEvent *evnt) +//{ + +//} + +//void SlugsVideoCamControl::mouseReleaseEvent(QMouseEvent *evnt) +//{ + +//} + +//void SlugsVideoCamControl::mouseDoubleClickEvent(QMouseEvent *evnt) +//{ + +//} diff --git a/src/ui/SlugsVideoCamControl.h b/src/ui/SlugsVideoCamControl.h new file mode 100644 index 0000000000000000000000000000000000000000..9ac37983ae4043d98e35ccaa0121fadd71c06d3f --- /dev/null +++ b/src/ui/SlugsVideoCamControl.h @@ -0,0 +1,38 @@ +#ifndef SLUGSVIDEOCAMCONTROL_H +#define SLUGSVIDEOCAMCONTROL_H + +#include +#include +#include +#include +#include + +namespace Ui { + class SlugsVideoCamControl; +} + +class SlugsVideoCamControl : public QGraphicsView + +{ + Q_OBJECT + +public: + explicit SlugsVideoCamControl(QWidget *parent = 0); + ~SlugsVideoCamControl(); + +protected: + // virtual void mousePressEvent(QMouseEvent* event); + //virtual void mouseReleaseEvent(QMouseEvent* event); + //void mouseMoveEvent(QMouseEvent* event); + void mouseMoveEvent(QMouseEvent* event); + // virtual void wheelEvent(QWheelEvent* event); + //virtual void resizeEvent(QResizeEvent* event); + + + + +private: + Ui::SlugsVideoCamControl *ui; +}; + +#endif // SLUGSVIDEOCAMCONTROL_H diff --git a/src/ui/SlugsVideoCamControl.ui b/src/ui/SlugsVideoCamControl.ui new file mode 100644 index 0000000000000000000000000000000000000000..ccea9870bf175d0bb3aabf714c52069372f2e098 --- /dev/null +++ b/src/ui/SlugsVideoCamControl.ui @@ -0,0 +1,71 @@ + + + SlugsVideoCamControl + + + + 0 + 0 + 443 + 351 + + + + true + + + Form + + + + + + true + + + background-color: rgb(255, 170, 0); + + + QFrame::WinPanel + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + + 0.000000000000000 + 0.000000000000000 + 200.000000000000000 + 200.000000000000000 + + + + + + + + true + + + TextLabel + + + + + + + true + + + TextLabel + + + + + + + +