|
|
@ -75,6 +75,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool |
|
|
|
, mIsDragInProgress(false) |
|
|
|
, mIsDragInProgress(false) |
|
|
|
, mMultipleSelectionIsEnabled(false) |
|
|
|
, mMultipleSelectionIsEnabled(false) |
|
|
|
, isControl(pIsControl) |
|
|
|
, isControl(pIsControl) |
|
|
|
|
|
|
|
, mRubberBandInPlayMode(false) //enables rubberband with play tool
|
|
|
|
{ |
|
|
|
{ |
|
|
|
init (); |
|
|
|
init (); |
|
|
|
|
|
|
|
|
|
|
@ -1020,38 +1021,41 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
if (currentTool != UBStylusTool::Play || mRubberBandInPlayMode) { |
|
|
|
|
|
|
|
|
|
|
|
QRect bandRect(mMouseDownPos, event->pos()); |
|
|
|
if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
|
|
|
|
|
|
|
|
bandRect = bandRect.normalized(); |
|
|
|
QRect bandRect(mMouseDownPos, event->pos()); |
|
|
|
|
|
|
|
|
|
|
|
mUBRubberBand->setGeometry(bandRect); |
|
|
|
bandRect = bandRect.normalized(); |
|
|
|
|
|
|
|
|
|
|
|
QList<QGraphicsItem *> rubberItems = items(bandRect); |
|
|
|
mUBRubberBand->setGeometry(bandRect); |
|
|
|
foreach (QGraphicsItem *item, mJustSelectedItems) { |
|
|
|
|
|
|
|
if (!rubberItems.contains(item)) { |
|
|
|
|
|
|
|
item->setSelected(false); |
|
|
|
|
|
|
|
mJustSelectedItems.remove(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentTool == UBStylusTool::Selector) |
|
|
|
|
|
|
|
foreach (QGraphicsItem *item, items(bandRect)) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item->type() == UBGraphicsW3CWidgetItem::Type |
|
|
|
QList<QGraphicsItem *> rubberItems = items(bandRect); |
|
|
|
|| item->type() == UBGraphicsPixmapItem::Type |
|
|
|
foreach (QGraphicsItem *item, mJustSelectedItems) { |
|
|
|
|| item->type() == UBGraphicsMediaItem::Type |
|
|
|
if (!rubberItems.contains(item)) { |
|
|
|
|| item->type() == UBGraphicsSvgItem::Type |
|
|
|
item->setSelected(false); |
|
|
|
|| item->type() == UBGraphicsTextItem::Type |
|
|
|
mJustSelectedItems.remove(item); |
|
|
|
|| item->type() == UBGraphicsStrokesGroup::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsGroupContainerItem::Type) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!mJustSelectedItems.contains(item)) { |
|
|
|
|
|
|
|
item->setSelected(true); |
|
|
|
|
|
|
|
mJustSelectedItems.insert(item); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentTool == UBStylusTool::Selector) |
|
|
|
|
|
|
|
foreach (QGraphicsItem *item, items(bandRect)) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item->type() == UBGraphicsW3CWidgetItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsPixmapItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsMediaItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsSvgItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsTextItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsStrokesGroup::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsGroupContainerItem::Type) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!mJustSelectedItems.contains(item)) { |
|
|
|
|
|
|
|
item->setSelected(true); |
|
|
|
|
|
|
|
mJustSelectedItems.insert(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|