+void MonitorScene::mousePressEvent(QGraphicsSceneMouseEvent* event)
+{
+ QList <QGraphicsItem *> selected = selectedItems();
+
+ QGraphicsScene::mousePressEvent(event);
+
+ if (selected.count() < selectedItems().count()) {
+ // mouse click on item not in selection group
+ // -> select only this item
+ foreach (QGraphicsItem *item, selected) {
+ if (item)
+ item->setSelected(false);
+ }
+ }
+
+ if (event->isAccepted() && selectedItems().count() > 1) {
+ // multiple items selected + mouse pressed on an item
+ selected = selectedItems();
+ foreach (QGraphicsItem *item, selected) {
+ if (qgraphicsitem_cast<BPointItem*>(item)) {
+ // works with rotoscoping only for now
+ m_groupMove = true;
+ m_lastPos = event->scenePos();
+ return;
+ }
+ }
+ }
+
+ if (!event->isAccepted() && event->buttons() & Qt::LeftButton) {
+ if (event->modifiers() == Qt::ControlModifier)
+ m_view->setDragMode(QGraphicsView::ScrollHandDrag);
+ else if (event->modifiers() == Qt::ShiftModifier)
+ m_view->setDragMode(QGraphicsView::RubberBandDrag);
+ }
+}
+