+void CustomTrackView::groupSelectedItems() {
+ QList<QGraphicsItem *> selection = m_scene->selectedItems();
+ if (selection.count() > 1) {
+ m_selectionGroup = new AbstractGroupItem(m_document->fps());
+ scene()->addItem(m_selectionGroup);
+ 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));
+ selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
+ }
+ }
+
+ if (m_selectionGroup) {
+ 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);
+ m_selectionGroupInfo.startPos = GenTime(m_selectionGroup->scenePos().x(), m_document->fps());
+ m_selectionGroupInfo.track = m_selectionGroup->track();
+ }
+ }
+}
+