//virtual void AbstractGroupItem::dropEvent(QGraphicsSceneDragDropEvent * event) { QString effects = QString(event->mimeData()->data("kdenlive/effectslist")); QDomDocument doc; doc.setContent(effects, true); QDomElement e = doc.documentElement(); CustomTrackView *view = (CustomTrackView *) scene()->views()[0]; if (view) view->slotAddGroupEffect(e, this); }
int AbstractGroupItem::posForTrack(int track) { int pos = 0; if (!scene() || scene()->views().isEmpty()) return pos; CustomTrackView *view = static_cast<CustomTrackView*>(scene()->views()[0]); if (view) { pos = view->getPositionFromTrack(track); } return pos; }
int AbstractGroupItem::trackForPos(int position) { int track = 1; if (!scene() || scene()->views().isEmpty()) return track; CustomTrackView *view = static_cast<CustomTrackView*>(scene()->views()[0]); if (view) { track = view->getTrackFromPos(position); } return track; }
//virtual void AbstractGroupItem::dropEvent(QGraphicsSceneDragDropEvent * event) { QString effects = QString::fromUtf8(event->mimeData()->data(QStringLiteral("kdenlive/effectslist"))); QDomDocument doc; doc.setContent(effects, true); QDomElement e = doc.documentElement(); e.setAttribute(QStringLiteral("kdenlive_ix"), 0); CustomTrackView *view = static_cast<CustomTrackView*>(scene()->views()[0]); QPointF dropPos = event->scenePos(); QList<QGraphicsItem *> selection = scene()->items(dropPos); AbstractClipItem *dropChild = NULL; for (int i = 0; i < selection.count(); ++i) { if (selection.at(i)->type() == AVWidget) { dropChild = static_cast<AbstractClipItem*>(selection.at(i)); break; } } if (view) view->slotAddGroupEffect(e, this, dropChild); }