|
|
|
@ -117,6 +117,7 @@ UBBoardView::init () |
|
|
|
|
mUsingTabletEraser = false; |
|
|
|
|
mIsCreatingTextZone = false; |
|
|
|
|
mRubberBand = 0; |
|
|
|
|
mUBRubberBand = 0; |
|
|
|
|
|
|
|
|
|
mVirtualKeyboardActive = false; |
|
|
|
|
|
|
|
|
@ -414,10 +415,19 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
|
} |
|
|
|
|
else if (currentTool == UBStylusTool::Selector) |
|
|
|
|
{ |
|
|
|
|
QSet<QGraphicsItem*> existingTools = scene()->tools(); |
|
|
|
|
// QSet<QGraphicsItem*> existingTools = scene()->tools(); why do we need to get tools here?
|
|
|
|
|
|
|
|
|
|
movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint())); |
|
|
|
|
|
|
|
|
|
if (!movingItem) { |
|
|
|
|
// Rubberband selection implementation
|
|
|
|
|
if (!mUBRubberBand) { |
|
|
|
|
mUBRubberBand = new UBRubberBand(QRubberBand::Rectangle, this); |
|
|
|
|
} |
|
|
|
|
mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ())); |
|
|
|
|
mUBRubberBand->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!movingItem |
|
|
|
|
|| movingItem->isSelected() |
|
|
|
|
|| movingItem->type() == UBGraphicsDelegateFrame::Type |
|
|
|
@ -443,6 +453,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
|
suspendedMousePressEvent = new QMouseEvent(event->type(), event->pos(), event->button(), event->buttons(), event->modifiers()); // удалить
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event->accept(); |
|
|
|
|
} |
|
|
|
|
else if (currentTool == UBStylusTool::Text) |
|
|
|
@ -470,7 +481,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
|
|
|
|
|
|
if (!mRubberBand) |
|
|
|
|
mRubberBand = new UBRubberBand (QRubberBand::Rectangle, this); |
|
|
|
|
|
|
|
|
|
mRubberBand->setGeometry (QRect (mMouseDownPos, QSize ())); |
|
|
|
|
mRubberBand->show (); |
|
|
|
|
mIsCreatingTextZone = true; |
|
|
|
@ -533,6 +543,10 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
|
mUBRubberBand->setGeometry(QRect(mMouseDownPos, event->pos()).normalized()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed)) |
|
|
|
|
{ |
|
|
|
|
QPointF scenePos = mapToScene(event->pos()); |
|
|
|
@ -598,6 +612,10 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event) |
|
|
|
|
suspendedMousePressEvent = NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
|
mUBRubberBand->hide(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QGraphicsView::mouseReleaseEvent (event); |
|
|
|
|
} |
|
|
|
|
else if (currentTool == UBStylusTool::Text) |
|
|
|
|