diff --git a/src/ui/SlugsVideoCamControl.cpp b/src/ui/SlugsVideoCamControl.cpp index 1729aeb9f0f1a5df0c661a5a5f6392284a867740..ed9ac5e3eb8335705480895b867a1689df8eed63 100644 --- a/src/ui/SlugsVideoCamControl.cpp +++ b/src/ui/SlugsVideoCamControl.cpp @@ -11,6 +11,7 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) : + QWidget(parent), ui(new Ui::SlugsVideoCamControl) { ui->setupUi(this); @@ -25,8 +26,8 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) : // setTransformationAnchor(AnchorUnderMouse); // setResizeAnchor(AnchorViewCenter); - ui->CamControlPanel_graphicsView->installEventFilter(this); - ui->label_x->installEventFilter(this); +// ui->CamControlPanel_graphicsView->installEventFilter(this); +// ui->label_x->installEventFilter(this); } @@ -37,8 +38,15 @@ SlugsVideoCamControl::~SlugsVideoCamControl() void SlugsVideoCamControl::mouseMoveEvent(QMouseEvent *event) { + QPoint tL = ui->widget->frameGeometry().topLeft(); + QPoint bR = ui->widget->frameGeometry().bottomRight(); + + if (!(event->x() > bR.x() || event->x() < tL.x() || + event->y() > bR.y() || event->y() < tL.y() )){ ui->label_x->setText(QString::number(event->x())); ui->label_y->setText(QString::number(event->y())); + } + } diff --git a/src/ui/SlugsVideoCamControl.h b/src/ui/SlugsVideoCamControl.h index 9ac37983ae4043d98e35ccaa0121fadd71c06d3f..5e09a27274ef13376be6b90f2f10f3bfb86d71f8 100644 --- a/src/ui/SlugsVideoCamControl.h +++ b/src/ui/SlugsVideoCamControl.h @@ -11,7 +11,7 @@ namespace Ui { class SlugsVideoCamControl; } -class SlugsVideoCamControl : public QGraphicsView +class SlugsVideoCamControl : public QWidget { Q_OBJECT diff --git a/src/ui/SlugsVideoCamControl.ui b/src/ui/SlugsVideoCamControl.ui index ccea9870bf175d0bb3aabf714c52069372f2e098..e872acef355e9f66c416c24e0f616af3fc1d6f7a 100644 --- a/src/ui/SlugsVideoCamControl.ui +++ b/src/ui/SlugsVideoCamControl.ui @@ -16,53 +16,40 @@ Form - - - + + + true - background-color: rgb(255, 170, 0); - - - QFrame::WinPanel - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - - 0.000000000000000 - 0.000000000000000 - 200.000000000000000 - 200.000000000000000 - + background-color: rgb(255, 193, 76); - - - - true - - - TextLabel - - - - - - - true - - - TextLabel - - + + + + + + true + + + TextLabel + + + + + + + true + + + TextLabel + + + +