}
}
-//virtual
void GraphicsSceneRectMove::keyPressEvent(QKeyEvent * keyEvent)
{
if (m_selectedItem == NULL) {
emit actionFinished();
}
-//virtual
void GraphicsSceneRectMove::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e)
{
QPointF p = e->scenePos();
p += QPoint(-2, -2);
m_resizeMode = NoResize;
m_selectedItem = NULL;
- QGraphicsItem* g = items(QRectF(p , QSizeF(4, 4)).toRect()).at(0);
+
+ // http://www.kdenlive.org/mantis/view.php?id=1035
+ QList<QGraphicsItem*> i = items(QRectF(p , QSizeF(4, 4)).toRect());
+ if (i.size() <= 0) return;
+
+ QGraphicsItem* g = i.at(0);
if (g) {
if (g->type() == 8) {
QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(g);
clearSelection();
}
-//virtual
void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e)
{
if ((e->screenPos() - m_clickPoint).manhattanLength() < QApplication::startDragDistance()) {
QPainterPath mouseArea;
mouseArea.addRect(e->scenePos().toPoint().x() - 4 / m_zoom, e->scenePos().toPoint().y() - 4 / m_zoom, 8 / m_zoom, 8 / m_zoom);
// Check for collisions between the mouse and the borders
- if (borderLeft.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea) || borderRight.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea))
+ if ((borderLeft.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea)) || (borderRight.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea)))
setResizeCursor(borderLeft.line().angle() - 45);
- else if (borderLeft.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea) || borderRight.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea))
+ else if ((borderLeft.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea)) || (borderRight.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea)))
setResizeCursor(borderLeft.line().angle() + 45);
else if (borderLeft.collidesWithPath(mouseArea) || borderRight.collidesWithPath(mouseArea))
setResizeCursor(borderLeft.line().angle());