diff --git a/src/ui/eventpixmapitem.cpp b/src/ui/eventpixmapitem.cpp index c85e5f59..e1e8480a 100644 --- a/src/ui/eventpixmapitem.cpp +++ b/src/ui/eventpixmapitem.cpp @@ -4,6 +4,8 @@ #include "mapruler.h" #include "metatile.h" +#include + EventPixmapItem::EventPixmapItem(Event *event) : QGraphicsPixmapItem(event->getPixmap()), m_basePixmap(pixmap()), @@ -75,6 +77,11 @@ void EventPixmapItem::updatePixelPosition() { void EventPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { if (m_active) return; + if (QApplication::mouseButtons() & Qt::MiddleButton) { + // Let the view handle the event so that it can pan instead of dragging this item. + mouseEvent->ignore(); + return; + } m_active = true; m_lastPos = Metatile::coordFromPixmapCoord(mouseEvent->scenePos());