Fix dropping files onto image viewer

Interactive QGraphicsViews eat all drag&drop events. Since we don't want
the view to be "interactive" anyhow, just set it to non-interactive.
Dragging the image around if it is larger than the view is not
implemented via drag&drop events, so it still works.

Fixes: QTCREATORBUG-25462
Change-Id: Iee403bab7ba83f897b4d2cca662c4e82ae4aa529
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2021-05-03 15:24:37 +02:00
parent 7f61347757
commit 6689f0e5f4

View File

@@ -67,6 +67,7 @@ ImageView::ImageView(ImageViewerFile *file)
setScene(new QGraphicsScene(this));
setTransformationAnchor(AnchorUnderMouse);
setDragMode(ScrollHandDrag);
setInteractive(false);
setViewportUpdateMode(FullViewportUpdate);
setFrameShape(QFrame::NoFrame);
setRenderHint(QPainter::SmoothPixmapTransform);