SlugsVideoCamControl.cpp 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
#include "SlugsVideoCamControl.h"
#include "ui_SlugsVideoCamControl.h"

#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QTextStream>
#include <QScrollBar>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QDebug>


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)
//{

//}