+ } else {
+ QList <QGraphicsItem *>list = scene()->items(event->scenePos());
+ // only allow group move if we click over an item in the group
+ foreach(const QGraphicsItem *item, list) {
+ if (item->type() == TransitionWidget || item->type() == AVWidget) {
+ QGraphicsItem::mousePressEvent(event);
+ return;
+ }
+ }
+ event->ignore();
+ }
+}
+
+void AbstractGroupItem::resizeStart(int diff)
+{
+ bool info = false;
+ if (m_resizeInfos.isEmpty())
+ info = true;
+ int maximum = diff;
+ QList <QGraphicsItem *> children = childItems();
+ QList <AbstractClipItem *> items;
+ int itemcount = 0;
+ for (int i = 0; i < children.count(); ++i) {
+ AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
+ if (item && item->type() == AVWidget) {
+ items << item;
+ if (info)
+ m_resizeInfos << item->info();
+ item->resizeStart((int)(m_resizeInfos.at(itemcount).startPos.frames(item->fps())) + diff);
+ int itemdiff = (int)(item->startPos() - m_resizeInfos.at(itemcount).startPos).frames(item->fps());
+ if (qAbs(itemdiff) < qAbs(maximum))
+ maximum = itemdiff;
+ ++itemcount;
+ }
+ }
+
+ for (int i = 0; i < items.count(); ++i)
+ items.at(i)->resizeStart((int)(m_resizeInfos.at(i).startPos.frames(items.at(i)->fps())) + maximum);
+}
+
+void AbstractGroupItem::resizeEnd(int diff)
+{
+ bool info = false;
+ if (m_resizeInfos.isEmpty())
+ info = true;
+ int maximum = diff;
+ QList <QGraphicsItem *> children = childItems();
+ QList <AbstractClipItem *> items;
+ int itemcount = 0;
+ for (int i = 0; i < children.count(); ++i) {
+ AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
+ if (item && item->type() == AVWidget) {
+ items << item;
+ if (info)
+ m_resizeInfos << item->info();
+ item->resizeEnd((int)(m_resizeInfos.at(itemcount).endPos.frames(item->fps())) + diff);
+ int itemdiff = (int)(item->endPos() - m_resizeInfos.at(itemcount).endPos).frames(item->fps());
+ if (qAbs(itemdiff) < qAbs(maximum))
+ maximum = itemdiff;
+ ++itemcount;
+ }
+ }
+
+ for (int i = 0; i < items.count(); ++i)
+ items.at(i)->resizeEnd((int)(m_resizeInfos.at(i).endPos.frames(items.at(i)->fps())) + maximum);
+}
+
+QList< ItemInfo > AbstractGroupItem::resizeInfos()
+{
+ return m_resizeInfos;
+}
+
+void AbstractGroupItem::clearResizeInfos()
+{
+ // m_resizeInfos.clear() will crash in some cases for unknown reasons - ttill
+ m_resizeInfos = QList <ItemInfo>();