seekCursorPos(mappedXPos);
}
+int CustomTrackView::getMousePos() const
+{
+ return qMax((int)(mapToScene(mapFromGlobal(QCursor::pos())).x() + 0.5), 0);
+}
+
// virtual
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++) {
}
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++) {