コード例 #1
0
ファイル: abstractgroupitem.cpp プロジェクト: rayl/kdenlive
//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);
}
コード例 #2
0
//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);
}