void FrameLabel::mouseMoveEvent(QMouseEvent *ev) { if(_image.isNull()) return; // Save mouse cursor position QPointF tmpPoint = ev->pos(); setMouseCursorPos(tmpPoint); // Update box width and height if box drawing is in progress if(_draw) { switch(_drawMode) { case nooba::lineDraw: { drawingLine.setP2(toOriginalImage(tmpPoint)); break; } default: break; } } // Inform main window of mouse move event emit onMouseMoveEvent(); }
bool ToolTipDemo::event(QEvent *event) { if (event->type() == QEvent::MouseMove) { QMouseEvent *mouserEvent = (QMouseEvent*)event; onMouseMoveEvent(mouserEvent); } return QWidget::event(event); }
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ bool InputService::mouseMoved(const OIS::MouseEvent& _mouseEvent) { pMouseMoveEvent_type pMouseEvent( new MouseMoveEvent(_mouseEvent, *m_pKeyModifierState) ); onMouseMoveEvent(pMouseEvent); return true; }
void FrameLabel::mouseMoveEvent(QMouseEvent *ev) { // Save mouse cursor position setMouseCursorPos(ev->pos()); // Update box width and height if box drawing is in progress if(drawBox) { box->setWidth(getMouseCursorPos().x()-startPoint.x()); box->setHeight(getMouseCursorPos().y()-startPoint.y()); } // Inform main window of mouse move event emit onMouseMoveEvent(); } // mouseMoveEvent()
int FrameLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QLabel::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: newMouseData((*reinterpret_cast< MouseData(*)>(_a[1]))); break; case 1: onMouseMoveEvent(); break; default: ; } _id -= 2; } return _id; }
CameraView::CameraView(QWidget *mainwindow, QWidget *parent,int tabIdx, SharedImageBuffer *sharedImageBuffer) : QWidget(parent), ui(new Ui::CameraView), sharedImageBuffer(sharedImageBuffer) { // Setup UI ui->setupUi(this); tabId = tabIdx; // Initialize internal flag isCameraConnected=false; // Set initial GUI state ui->frameLabel->setText("No camera connected."); ui->imageBufferBar->setValue(0); ui->imageBufferLabel->setText("[000/000]"); ui->captureRateLabel->setText(""); ui->processingRateLabel->setText(""); ui->deviceNumberLabel->setText(""); ui->cameraResolutionLabel->setText(""); ui->roiLabel->setText(""); ui->mouseCursorPosLabel->setText(""); ui->clearImageBufferButton->setDisabled(true); // Initialize ImageProcessingFlags structure imageProcessingFlags.grayscaleOn=false; imageProcessingFlags.smoothOn=false; imageProcessingFlags.dilateOn=false; imageProcessingFlags.erodeOn=false; imageProcessingFlags.flipOn=false; imageProcessingFlags.cannyOn=false; // Connect signals/slots connect(ui->frameLabel, SIGNAL(onMouseMoveEvent()), this, SLOT(updateMouseCursorPosLabel())); connect(ui->clearImageBufferButton, SIGNAL(released()), this, SLOT(clearImageBuffer())); connect(ui->frameLabel->menu, SIGNAL(triggered(QAction*)), this, SLOT(handleContextMenuAction(QAction*))); connect(ui->startStopDatalogger, SIGNAL(released()), this, SLOT(startStopDatalogger())); connect(this, SIGNAL(setROI(QRect)), mainwindow, SLOT(newROI(QRect))); // Register type qRegisterMetaType<struct ThreadStatisticsData>("ThreadStatisticsData"); id++; pYarpDataloggerCtrl.initPortSend(YARPPORT_SEND_DATALOGGERCTRL,YARPPORT_RCV_DATALOGGERCTRL,"tcp"); recordingDlg = false; isVideo = false; }