fix scale center and mouse scroll issue
This commit is contained in:
parent
b1260c0b41
commit
3576235d14
|
@ -15,6 +15,7 @@ GraphicsView::GraphicsView(QWidget *parent)
|
||||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setResizeAnchor(QGraphicsView::AnchorUnderMouse);
|
setResizeAnchor(QGraphicsView::AnchorUnderMouse);
|
||||||
|
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
|
||||||
setStyleSheet("background-color: rgba(0, 0, 0, 220);"
|
setStyleSheet("background-color: rgba(0, 0, 0, 220);"
|
||||||
"border-radius: 3px;");
|
"border-radius: 3px;");
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
@ -180,8 +181,7 @@ void GraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
||||||
void GraphicsView::wheelEvent(QWheelEvent *event)
|
void GraphicsView::wheelEvent(QWheelEvent *event)
|
||||||
{
|
{
|
||||||
event->ignore();
|
event->ignore();
|
||||||
|
// blumia: no need for calling parent method.
|
||||||
return QGraphicsView::wheelEvent(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::resizeEvent(QResizeEvent *event)
|
void GraphicsView::resizeEvent(QResizeEvent *event)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user