|
|
@ -46,6 +46,9 @@ |
|
|
|
#include "domain/UBGraphicsPDFItem.h" |
|
|
|
#include "domain/UBGraphicsPDFItem.h" |
|
|
|
#include "domain/UBGraphicsPolygonItem.h" |
|
|
|
#include "domain/UBGraphicsPolygonItem.h" |
|
|
|
#include "domain/UBItem.h" |
|
|
|
#include "domain/UBItem.h" |
|
|
|
|
|
|
|
#include "domain/UBGraphicsVideoItem.h" |
|
|
|
|
|
|
|
#include "domain/UBGraphicsAudioItem.h" |
|
|
|
|
|
|
|
#include "domain/UBGraphicsSvgItem.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "document/UBDocumentProxy.h" |
|
|
|
#include "document/UBDocumentProxy.h" |
|
|
|
|
|
|
|
|
|
|
@ -517,6 +520,8 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QSet<QGraphicsItem*> mJustSelectedItems; |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -544,7 +549,32 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
if (mUBRubberBand && mUBRubberBand->isVisible()) { |
|
|
|
mUBRubberBand->setGeometry(QRect(mMouseDownPos, event->pos()).normalized()); |
|
|
|
QRect bandRect(mMouseDownPos, event->pos()); |
|
|
|
|
|
|
|
bandRect = bandRect.normalized(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mUBRubberBand->setGeometry(bandRect); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QList<QGraphicsItem *> rubberItems = items(bandRect); |
|
|
|
|
|
|
|
foreach (QGraphicsItem *item, mJustSelectedItems) { |
|
|
|
|
|
|
|
if (!rubberItems.contains(item)) { |
|
|
|
|
|
|
|
item->setSelected(false); |
|
|
|
|
|
|
|
mJustSelectedItems.remove(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
foreach (QGraphicsItem *item, items(bandRect)) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item->type() == UBGraphicsW3CWidgetItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsPixmapItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsVideoItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsAudioItem::Type |
|
|
|
|
|
|
|
|| item->type() == UBGraphicsSvgItem::Type) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!mJustSelectedItems.contains(item)) { |
|
|
|
|
|
|
|
item->setSelected(true); |
|
|
|
|
|
|
|
mJustSelectedItems.insert(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed)) |
|
|
|
if (movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed)) |
|
|
|