void ScreenshotsWidget::mouseMoveEvent(QMouseEvent *event) { //当拖动时,动态的更新所选择的区域 if(currentShotState == beginShot){ endPoint = event->pos(); update(); } //当确定选区后,对选区进行移动操作 if(currentShotState == beginMoveShot || currentShotState == beginControl){ moveEndPoint = event->pos(); update(); } updateMouseShape(event->pos()); //修改鼠标的形状 setMouseTracking(true); }
void WizScreenShotWidget::mouseMoveEvent(QMouseEvent *event) { if (currentShotState == beginShot) { endPoint = event->pos(); update(); } if (currentShotState == beginMoveShot || currentShotState == beginControl) { moveEndPoint = event->pos(); update(); } updateMouseShape(event->pos()); setMouseTracking(true); }