fix scale center and mouse scroll issue

This commit is contained in:
Gary Wang 2019-10-07 14:46:22 +08:00
parent b1260c0b41
commit 3576235d14

View File

@ -15,6 +15,7 @@ GraphicsView::GraphicsView(QWidget *parent)
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setResizeAnchor(QGraphicsView::AnchorUnderMouse);
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setStyleSheet("background-color: rgba(0, 0, 0, 220);"
"border-radius: 3px;");
setAcceptDrops(true);
@ -180,8 +181,7 @@ void GraphicsView::mouseReleaseEvent(QMouseEvent *event)
void GraphicsView::wheelEvent(QWheelEvent *event)
{
event->ignore();
return QGraphicsView::wheelEvent(event);
// blumia: no need for calling parent method.
}
void GraphicsView::resizeEvent(QResizeEvent *event)