]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
Show project duration in status bar
[kdenlive] / src / customtrackview.cpp
index b178039a6fbcc8cdc79f430bd477f031344936f1..f069ed9d037ce885236d7f110230cea28f6ee5da 100644 (file)
@@ -422,6 +422,11 @@ void CustomTrackView::slotAlignPlayheadToMousePos()
        seekCursorPos(mappedXPos);
 }
 
+int CustomTrackView::getMousePos() const
+{
+    return qMax((int)(mapToScene(mapFromGlobal(QCursor::pos())).x() + 0.5), 0);
+}
+
 // virtual
 void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
 {
@@ -511,7 +516,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
 
             // Make sure there is no collision
             QList<QGraphicsItem *> children = m_selectionGroup->childItems();
-            QPainterPath shape = m_selectionGroup->clipGroupShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
+            QPainterPath shape = m_selectionGroup->clipGroupSpacerShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
             QList<QGraphicsItem*> collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
             collidingItems.removeAll(m_selectionGroup);
             for (int i = 0; i < children.count(); i++) {
@@ -537,7 +542,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
             }
             snappedPos += offset;
             // make sure we have no collision
-            shape = m_selectionGroup->clipGroupShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
+            shape = m_selectionGroup->clipGroupSpacerShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
             collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
             collidingItems.removeAll(m_selectionGroup);
             for (int i = 0; i < children.count(); i++) {