http://www.kdenlive.org:80/mantis/view.php?id=604
svn path=/branches/KDE4/; revision=3024
- return QGraphicsItem::itemChange(change, value);
+ return QGraphicsItemGroup::itemChange(change, value);
if (event->modifiers() == Qt::ControlModifier) {
// Ctrl + click, select all items on track after click position
int track = (int)(mapToScene(m_clickEvent).y() / m_tracksHeight);
if (event->modifiers() == Qt::ControlModifier) {
// Ctrl + click, select all items on track after click position
int track = (int)(mapToScene(m_clickEvent).y() / m_tracksHeight);
- selection = items(m_clickEvent.x(), track * m_tracksHeight + 1, mapFromScene(sceneRect().width(), 0).x() - m_clickEvent.x(), m_tracksHeight - 2);
- // for (int count = 0; count < selection.size(); count++) {
- // selection.at(count);
- // }
+ selection = items(m_clickEvent.x(), track * m_tracksHeight + m_tracksHeight / 2, mapFromScene(sceneRect().width(), 0).x() - m_clickEvent.x(), m_tracksHeight / 2 - 2);
+
kDebug() << "SPACER TOOL + CTRL, SELECTING ALL CLIPS ON TRACK " << track << " WITH SELECTION RECT " << m_clickEvent.x() << "/" << track * m_tracksHeight + 1 << "; " << mapFromScene(sceneRect().width(), 0).x() - m_clickEvent.x() << "/" << m_tracksHeight - 2;
} else {
// Select all items on all tracks after click position
kDebug() << "SPACER TOOL + CTRL, SELECTING ALL CLIPS ON TRACK " << track << " WITH SELECTION RECT " << m_clickEvent.x() << "/" << track * m_tracksHeight + 1 << "; " << mapFromScene(sceneRect().width(), 0).x() - m_clickEvent.x() << "/" << m_tracksHeight - 2;
} else {
// Select all items on all tracks after click position
bool snap = KdenliveSettings::snaptopoints();
KdenliveSettings::setSnaptopoints(false);
QList<QGraphicsItem *> children = m_selectionGroup->childItems();
bool snap = KdenliveSettings::snaptopoints();
KdenliveSettings::setSnaptopoints(false);
QList<QGraphicsItem *> children = m_selectionGroup->childItems();
+ scene()->destroyItemGroup(m_selectionGroup);
for (int i = 0; i < children.count(); i++) {
children.at(i)->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
children.at(i)->setSelected(selectItems);
}
for (int i = 0; i < children.count(); i++) {
children.at(i)->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
children.at(i)->setSelected(selectItems);
}
- scene()->destroyItemGroup(m_selectionGroup);
m_selectionGroup = NULL;
KdenliveSettings::setSnaptopoints(snap);
}
m_selectionGroup = NULL;
KdenliveSettings::setSnaptopoints(snap);
}
return;
}
QList<QGraphicsItem *> selection = m_scene->selectedItems();
return;
}
QList<QGraphicsItem *> selection = m_scene->selectedItems();
+ QGraphicsItemGroup *group = m_scene->createItemGroup(selection);
+ scene()->addItem(group);
+ QPointF top = group->sceneBoundingRect().topLeft();
+ m_scene->destroyItemGroup(group);
if (force || selection.count() > 1) {
if (force || selection.count() > 1) {
+ bool snap = KdenliveSettings::snaptopoints();
+ KdenliveSettings::setSnaptopoints(false);
m_selectionGroup = new AbstractGroupItem(m_document->fps());
m_selectionGroup = new AbstractGroupItem(m_document->fps());
+ m_selectionGroup->translate(-top.x(), -top.y() + 1);
+ m_selectionGroup->setPos(top.x(), top.y() - 1);
scene()->addItem(m_selectionGroup);
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET) {
scene()->addItem(m_selectionGroup);
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET) {
selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
}
}
selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
}
}
+ KdenliveSettings::setSnaptopoints(snap);
- bool snap = KdenliveSettings::snaptopoints();
+ /*bool snap = KdenliveSettings::snaptopoints();
KdenliveSettings::setSnaptopoints(false);
QPointF top = m_selectionGroup->sceneBoundingRect().topLeft();
KdenliveSettings::setSnaptopoints(false);
QPointF top = m_selectionGroup->sceneBoundingRect().topLeft();
- m_selectionGroup->translate(-top.x(), -top.y() + 1);
- m_selectionGroup->setPos(top);
+ // kDebug()<<"SEL GRP TOP: "<<top;
+ // Fix group item position
+ m_selectionGroup->translate(-top.x(), -top.y());
+ m_selectionGroup->setPos(top);*/
m_selectionGroupInfo.startPos = GenTime(m_selectionGroup->scenePos().x(), m_document->fps());
m_selectionGroupInfo.track = m_selectionGroup->track();
m_selectionGroupInfo.startPos = GenTime(m_selectionGroup->scenePos().x(), m_document->fps());
m_selectionGroupInfo.track = m_selectionGroup->track();
- KdenliveSettings::setSnaptopoints(snap);
+ //KdenliveSettings::setSnaptopoints(snap);
}
} else resetSelectionGroup();
}
}
} else resetSelectionGroup();
}