svn path=/trunk/kdenlive/; revision=4064
m_fps(fps)
{
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
m_fps(fps)
{
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+#if QT_VERSION >= 0x040600
+ setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
+#endif
}
ItemInfo AbstractClipItem::info() const
}
ItemInfo AbstractClipItem::info() const
setSelected(false);
setFlag(QGraphicsItem::ItemIsMovable, false);
setFlag(QGraphicsItem::ItemIsSelectable, false);
setSelected(false);
setFlag(QGraphicsItem::ItemIsMovable, false);
setFlag(QGraphicsItem::ItemIsSelectable, false);
- } else setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ } else {
+ setFlag(QGraphicsItem::ItemIsMovable, true);
+ setFlag(QGraphicsItem::ItemIsSelectable, true);
+ }
}
bool AbstractClipItem::isItemLocked() const
}
bool AbstractClipItem::isItemLocked() const
{
setZValue(1);
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
{
setZValue(1);
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+#if QT_VERSION >= 0x040600
+ setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
+#endif
offsetList.append(item->startPos());
offsetList.append(item->endPos());
m_selectionGroup->addToGroup(selection.at(i));
offsetList.append(item->startPos());
offsetList.append(item->endPos());
m_selectionGroup->addToGroup(selection.at(i));
- selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
+ selection.at(i)->setFlag(QGraphicsItem::ItemIsMovable, false);
} else if (selection.at(i)->parentItem() == 0 && selection.at(i)->type() == GROUPWIDGET) {
QList<QGraphicsItem *> children = selection.at(i)->childItems();
for (int j = 0; j < children.count(); j++) {
} else if (selection.at(i)->parentItem() == 0 && selection.at(i)->type() == GROUPWIDGET) {
QList<QGraphicsItem *> children = selection.at(i)->childItems();
for (int j = 0; j < children.count(); j++) {
offsetList.append(item->endPos());
}
m_selectionGroup->addToGroup(selection.at(i));
offsetList.append(item->endPos());
}
m_selectionGroup->addToGroup(selection.at(i));
- selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
+ selection.at(i)->setFlag(QGraphicsItem::ItemIsMovable, false);
} else if (selection.at(i)->parentItem()) {
m_selectionGroup->addToGroup(selection.at(i)->parentItem());
} else if (selection.at(i)->parentItem()) {
m_selectionGroup->addToGroup(selection.at(i)->parentItem());
- selection.at(i)->parentItem()->setFlags(QGraphicsItem::ItemIsSelectable);
+ selection.at(i)->parentItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
for (int i = 0; i < children.count(); i++) {
if (children.at(i)->parentItem() == 0 && (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET)) {
if (!static_cast <AbstractClipItem *>(children.at(i))->isItemLocked()) {
for (int i = 0; i < children.count(); i++) {
if (children.at(i)->parentItem() == 0 && (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET)) {
if (!static_cast <AbstractClipItem *>(children.at(i))->isItemLocked()) {
- children.at(i)->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
children.at(i)->setSelected(selectItems);
}
} else if (children.at(i)->type() == GROUPWIDGET) {
children.at(i)->setSelected(selectItems);
}
} else if (children.at(i)->type() == GROUPWIDGET) {
- children.at(i)->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
children.at(i)->setSelected(selectItems);
}
}
children.at(i)->setSelected(selectItems);
}
}
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET) {
newGroup->addToGroup(selection.at(i));
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET) {
newGroup->addToGroup(selection.at(i));
- selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
+ selection.at(i)->setFlag(QGraphicsItem::ItemIsMovable, false);
}
}
KdenliveSettings::setSnaptopoints(snap);
}
}
KdenliveSettings::setSnaptopoints(snap);
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->parentItem() == 0 && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
m_selectionGroup->addToGroup(selection.at(i));
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->parentItem() == 0 && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
m_selectionGroup->addToGroup(selection.at(i));
- selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
+ selection.at(i)->setFlag(QGraphicsItem::ItemIsMovable, false);
}
}
KdenliveSettings::setSnaptopoints(snap);
}
}
KdenliveSettings::setSnaptopoints(snap);
m_selectionGroup = new AbstractGroupItem(m_document->fps());
ClipItem *item = new ClipItem(clip, info, m_document->fps(), 1.0, 1);
m_selectionGroup->addToGroup(item);
m_selectionGroup = new AbstractGroupItem(m_document->fps());
ClipItem *item = new ClipItem(clip, info, m_document->fps(), 1.0, 1);
m_selectionGroup->addToGroup(item);
- item->setFlags(QGraphicsItem::ItemIsSelectable);
+ item->setFlag(QGraphicsItem::ItemIsMovable, false);
QList <GenTime> offsetList;
offsetList.append(info.endPos);
QList <GenTime> offsetList;
offsetList.append(info.endPos);
offsetList.append(start);
ClipItem *item = new ClipItem(clip, info, m_document->fps(), 1.0, 1, false);
item->setZValue(10);
offsetList.append(start);
ClipItem *item = new ClipItem(clip, info, m_document->fps(), 1.0, 1, false);
item->setZValue(10);
- item->setFlags(QGraphicsItem::ItemIsSelectable);
+ item->setFlag(QGraphicsItem::ItemIsMovable, false);
m_selectionGroup->addToGroup(item);
m_waitingThumbs.append(item);
}
m_selectionGroup->addToGroup(item);
m_waitingThumbs.append(item);
}
for (int i = 0; i < selection.count(); i++) {
if ((!selection.at(i)->parentItem()) && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
m_selectionGroup->addToGroup(selection.at(i));
for (int i = 0; i < selection.count(); i++) {
if ((!selection.at(i)->parentItem()) && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
m_selectionGroup->addToGroup(selection.at(i));
- selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
+ selection.at(i)->setFlag(QGraphicsItem::ItemIsMovable, false);
}
}
// Move graphic items
}
}
// Move graphic items
for (int i = 0; i < selection.count(); i++) {
if ((!selection.at(i)->parentItem()) && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
m_selectionGroup->addToGroup(selection.at(i));
for (int i = 0; i < selection.count(); i++) {
if ((!selection.at(i)->parentItem()) && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
m_selectionGroup->addToGroup(selection.at(i));
- selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
+ selection.at(i)->setFlag(QGraphicsItem::ItemIsMovable, false);
}
}
// Move graphic items
}
}
// Move graphic items
if (clip) {
if (clip->parentItem()) {
m_selectionGroup->addToGroup(clip->parentItem());
if (clip) {
if (clip->parentItem()) {
m_selectionGroup->addToGroup(clip->parentItem());
- clip->parentItem()->setFlags(QGraphicsItem::ItemIsSelectable);
+ clip->parentItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
} else {
m_selectionGroup->addToGroup(clip);
} else {
m_selectionGroup->addToGroup(clip);
- clip->setFlags(QGraphicsItem::ItemIsSelectable);
+ clip->setFlag(QGraphicsItem::ItemIsMovable, false);
}
if (trackClipStartList.value(m_document->tracksCount() - clipsToMove.at(i).track) == -1 || clipsToMove.at(i).startPos.frames(m_document->fps()) < trackClipStartList.value(m_document->tracksCount() - clipsToMove.at(i).track))
trackClipStartList[m_document->tracksCount() - clipsToMove.at(i).track] = clipsToMove.at(i).startPos.frames(m_document->fps());
}
if (trackClipStartList.value(m_document->tracksCount() - clipsToMove.at(i).track) == -1 || clipsToMove.at(i).startPos.frames(m_document->fps()) < trackClipStartList.value(m_document->tracksCount() - clipsToMove.at(i).track))
trackClipStartList[m_document->tracksCount() - clipsToMove.at(i).track] = clipsToMove.at(i).startPos.frames(m_document->fps());
if (transition) {
if (transition->parentItem()) {
m_selectionGroup->addToGroup(transition->parentItem());
if (transition) {
if (transition->parentItem()) {
m_selectionGroup->addToGroup(transition->parentItem());
- transition->parentItem()->setFlags(QGraphicsItem::ItemIsSelectable);
+ transition->parentItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
} else {
m_selectionGroup->addToGroup(transition);
} else {
m_selectionGroup->addToGroup(transition);
- transition->setFlags(QGraphicsItem::ItemIsSelectable);
+ transition->setFlag(QGraphicsItem::ItemIsMovable, false);
}
if (trackTransitionStartList.value(m_document->tracksCount() - transToMove.at(i).track) == -1 || transToMove.at(i).startPos.frames(m_document->fps()) < trackTransitionStartList.value(m_document->tracksCount() - transToMove.at(i).track))
trackTransitionStartList[m_document->tracksCount() - transToMove.at(i).track] = transToMove.at(i).startPos.frames(m_document->fps());
}
if (trackTransitionStartList.value(m_document->tracksCount() - transToMove.at(i).track) == -1 || transToMove.at(i).startPos.frames(m_document->fps()) < trackTransitionStartList.value(m_document->tracksCount() - transToMove.at(i).track))
trackTransitionStartList[m_document->tracksCount() - transToMove.at(i).track] = transToMove.at(i).startPos.frames(m_document->fps());
m_document->clipManager()->removeGroup(grp);
scene()->destroyItemGroup(grp);
}
m_document->clipManager()->removeGroup(grp);
scene()->destroyItemGroup(grp);
}
- clip->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ clip->setFlag(QGraphicsItem::ItemIsMovable, true);
}
for (int i = 0; i < transitionInfos.count(); i++) {
Transition *tr = getTransitionItemAt(transitionInfos.at(i).startPos, transitionInfos.at(i).track);
}
for (int i = 0; i < transitionInfos.count(); i++) {
Transition *tr = getTransitionItemAt(transitionInfos.at(i).startPos, transitionInfos.at(i).track);
m_document->clipManager()->removeGroup(grp);
scene()->destroyItemGroup(grp);
}
m_document->clipManager()->removeGroup(grp);
scene()->destroyItemGroup(grp);
}
- tr->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ tr->setFlag(QGraphicsItem::ItemIsMovable, true);
}
setDocumentModified();
return;
}
setDocumentModified();
return;
clip->setItemLocked(false);
if (clip->parentItem()) {
m_selectionGroup->addToGroup(clip->parentItem());
clip->setItemLocked(false);
if (clip->parentItem()) {
m_selectionGroup->addToGroup(clip->parentItem());
- clip->parentItem()->setFlags(QGraphicsItem::ItemIsSelectable);
+ clip->parentItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
} else {
m_selectionGroup->addToGroup(clip);
} else {
m_selectionGroup->addToGroup(clip);
- clip->setFlags(QGraphicsItem::ItemIsSelectable);
+ clip->setFlag(QGraphicsItem::ItemIsMovable, false);
}
m_document->renderer()->mltRemoveClip(m_document->tracksCount() - startClip.at(i).track, startClip.at(i).startPos);
} else kDebug() << "//MISSING CLIP AT: " << startClip.at(i).startPos.frames(25);
}
m_document->renderer()->mltRemoveClip(m_document->tracksCount() - startClip.at(i).track, startClip.at(i).startPos);
} else kDebug() << "//MISSING CLIP AT: " << startClip.at(i).startPos.frames(25);
tr->setItemLocked(false);
if (tr->parentItem()) {
m_selectionGroup->addToGroup(tr->parentItem());
tr->setItemLocked(false);
if (tr->parentItem()) {
m_selectionGroup->addToGroup(tr->parentItem());
- tr->parentItem()->setFlags(QGraphicsItem::ItemIsSelectable);
+ tr->parentItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
} else {
m_selectionGroup->addToGroup(tr);
} else {
m_selectionGroup->addToGroup(tr);
- tr->setFlags(QGraphicsItem::ItemIsSelectable);
+ tr->setFlag(QGraphicsItem::ItemIsMovable, false);
}
m_document->renderer()->mltDeleteTransition(tr->transitionTag(), tr->transitionEndTrack(), m_document->tracksCount() - startTransition.at(i).track, startTransition.at(i).startPos, startTransition.at(i).endPos, tr->toXML());
} else kDebug() << "//MISSING TRANSITION AT: " << startTransition.at(i).startPos.frames(25);
}
m_document->renderer()->mltDeleteTransition(tr->transitionTag(), tr->transitionEndTrack(), m_document->tracksCount() - startTransition.at(i).track, startTransition.at(i).startPos, startTransition.at(i).endPos, tr->toXML());
} else kDebug() << "//MISSING TRANSITION AT: " << startTransition.at(i).startPos.frames(25);
- clip->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ clip->setFlag(QGraphicsItem::ItemIsMovable, true);
m_document->clipManager()->removeGroup(grp);
scene()->destroyItemGroup(grp);
}
m_document->clipManager()->removeGroup(grp);
scene()->destroyItemGroup(grp);
}
for (int j = 0; j < children.count(); j++) {
if (children.at(j)->type() == AVWIDGET || children.at(j)->type() == TRANSITIONWIDGET) {
AbstractClipItem *clip = static_cast <AbstractClipItem *>(children.at(j));
for (int j = 0; j < children.count(); j++) {
if (children.at(j)->type() == AVWIDGET || children.at(j)->type() == TRANSITIONWIDGET) {
AbstractClipItem *clip = static_cast <AbstractClipItem *>(children.at(j));
- clip->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ clip->setFlag(QGraphicsItem::ItemIsMovable, true);
clip->updateFps(m_document->fps());
}
}
clip->updateFps(m_document->fps());
}
}
m_pen(QPen())
{
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIgnoresTransformations);
m_pen(QPen())
{
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIgnoresTransformations);
+#if QT_VERSION >= 0x040600
+ setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
+#endif
setToolTip(label);
setLine(0, 0, 0, height);
setPos(m_position.frames(m_view->fps()), 0);
setToolTip(label);
setLine(0, 0, 0, height);
setPos(m_position.frames(m_view->fps()), 0);