+ if (m_tool == SPACERTOOL) {
+ // Select all items on track after click position
+ int track = (int)(mapToScene(m_clickEvent).y() / m_tracksHeight);
+ QList<QGraphicsItem *> selection = items(event->pos().x(), track * m_tracksHeight + 1, sceneRect().width() - event->pos().x(), m_tracksHeight - 2);
+ m_selectionGroup = new AbstractGroupItem(m_document->fps());
+ scene()->addItem(m_selectionGroup);
+ m_spacerStart = -1;
+ int itemStart;
+ for (int i = 0; i < selection.count(); i++) {
+ if (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET) {
+ m_selectionGroup->addToGroup(selection.at(i));
+ AbstractClipItem *item = static_cast <AbstractClipItem *>(selection.at(i));
+ itemStart = item->startPos().frames(m_document->fps());
+ if (m_spacerStart == -1 || itemStart < m_spacerStart)
+ m_spacerStart = itemStart;
+ }
+ }
+ QPointF top = m_selectionGroup->boundingRect().topLeft();
+ const int width = m_selectionGroup->boundingRect().width();
+ const int height = m_selectionGroup->boundingRect().height();
+ m_selectionGroup->setPos(top);
+ m_selectionGroup->translate(-top.x(), -top.y() + 1);
+ //kDebug()<<"// SPACER START GRP: "<<m_spacerStart;
+ m_operationMode = SPACER;
+ } else setCursorPos((int)(mapToScene(event->x(), 0).x()));