From c7aecd12ea324dc0d3f7aadb0dd68f7f44d36559 Mon Sep 17 00:00:00 2001 From: Mariano Lizarraga Date: Fri, 19 Nov 2010 19:44:16 -0600 Subject: [PATCH] Changed the dragging frame for a QWidget in the slugs camera control --- src/ui/SlugsVideoCamControl.cpp | 12 +++++- src/ui/SlugsVideoCamControl.h | 2 +- src/ui/SlugsVideoCamControl.ui | 67 +++++++++++++-------------------- 3 files changed, 38 insertions(+), 43 deletions(-) diff --git a/src/ui/SlugsVideoCamControl.cpp b/src/ui/SlugsVideoCamControl.cpp index 1729aeb9f..ed9ac5e3e 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 9ac37983a..5e09a2727 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 ccea9870b..e872acef3 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 + + + + -- 2.22.0