|
|
@ -715,11 +715,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
mPreviousPoint = event->posF (); |
|
|
|
mPreviousPoint = event->posF (); |
|
|
|
event->accept (); |
|
|
|
event->accept (); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (currentTool == UBStylusTool::Eraser) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
connect(&mLongPressTimer, SIGNAL(timeout()), this, SLOT(longPressEvent())); |
|
|
|
|
|
|
|
mLongPressTimer.start(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (currentTool == UBStylusTool::Selector || currentTool == UBStylusTool::Play) |
|
|
|
else if (currentTool == UBStylusTool::Selector || currentTool == UBStylusTool::Play) |
|
|
|
{ |
|
|
|
{ |
|
|
|
movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint())); |
|
|
|
movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint())); |
|
|
@ -797,6 +792,11 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
|
|
|
|
|
|
|
|
if (scene () && !mTabletStylusIsPressed) |
|
|
|
if (scene () && !mTabletStylusIsPressed) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (currentTool == UBStylusTool::Eraser) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
connect(&mLongPressTimer, SIGNAL(timeout()), this, SLOT(longPressEvent())); |
|
|
|
|
|
|
|
mLongPressTimer.start(); |
|
|
|
|
|
|
|
} |
|
|
|
scene ()->inputDevicePress (mapToScene (UBGeometryUtils::pointConstrainedInRect (event->pos (), rect ()))); |
|
|
|
scene ()->inputDevicePress (mapToScene (UBGeometryUtils::pointConstrainedInRect (event->pos (), rect ()))); |
|
|
|
} |
|
|
|
} |
|
|
|
event->accept (); |
|
|
|
event->accept (); |
|
|
@ -809,12 +809,14 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(!mIsDragInProgress && ((mapToScene(event->pos()) - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance()))
|
|
|
|
if(!mIsDragInProgress && ((mapToScene(event->pos()) - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance()))
|
|
|
|
{ |
|
|
|
{ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mIsDragInProgress = true; |
|
|
|
mIsDragInProgress = true; |
|
|
|
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); |
|
|
|
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mLongPressTimer.stop(); |
|
|
|
|
|
|
|
|
|
|
|
if (isAbsurdPoint (event->pos ())) |
|
|
|
if (isAbsurdPoint (event->pos ())) |
|
|
|
{ |
|
|
|
{ |
|
|
|
event->accept (); |
|
|
|
event->accept (); |
|
|
@ -830,18 +832,12 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
mPreviousPoint = eventPosition; |
|
|
|
mPreviousPoint = eventPosition; |
|
|
|
event->accept (); |
|
|
|
event->accept (); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (currentTool == UBStylusTool::Eraser) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mLongPressTimer.stop(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (currentTool == UBStylusTool::Selector || currentTool == UBStylusTool::Play) |
|
|
|
else if (currentTool == UBStylusTool::Selector || currentTool == UBStylusTool::Play) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if((event->pos() - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance()) { |
|
|
|
if((event->pos() - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance()) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mLongPressTimer.stop(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
|
|
|
|
|
|
|
|
QRect bandRect(mMouseDownPos, event->pos()); |
|
|
|
QRect bandRect(mMouseDownPos, event->pos()); |
|
|
@ -899,7 +895,7 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!mTabletStylusIsPressed && scene ()) |
|
|
|
if (!mTabletStylusIsPressed && scene ()) |
|
|
|
{ |
|
|
|
{
|
|
|
|
scene ()->inputDeviceMove (mapToScene (UBGeometryUtils::pointConstrainedInRect (event->pos (), rect ())), mMouseButtonIsPressed); |
|
|
|
scene ()->inputDeviceMove (mapToScene (UBGeometryUtils::pointConstrainedInRect (event->pos (), rect ())), mMouseButtonIsPressed); |
|
|
|
} |
|
|
|
} |
|
|
|
event->accept (); |
|
|
|
event->accept (); |
|
|
|