mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
fix deprecated warning int QWheelEvent::delta() const
Use angleDelta() instead manhattanLength() Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point. This class was introduced in Qt 5.5
This commit is contained in:
committed by
Laurent Trinques
parent
bb093ba0cd
commit
71abaf92cb
@@ -415,11 +415,11 @@ void ElementView::wheelEvent(QWheelEvent *e) {
|
||||
//Zoom and scrolling
|
||||
if ( gestures() ) {
|
||||
if (e -> modifiers() & Qt::ControlModifier)
|
||||
e -> delta() > 0 ? zoomInSlowly() : zoomOutSlowly();
|
||||
e -> angleDelta().manhattanLength() > 0 ? zoomInSlowly() : zoomOutSlowly();
|
||||
else
|
||||
QGraphicsView::wheelEvent(e);
|
||||
} else {
|
||||
e -> delta() > 0 ? zoomIn(): zoomOut();
|
||||
e -> angleDelta().manhattanLength() > 0 ? zoomIn(): zoomOut();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -511,7 +511,7 @@ qreal TitleBlockTemplateView::templateHeight() const {
|
||||
void TitleBlockTemplateView::wheelEvent(QWheelEvent *e) {
|
||||
// si la touche Ctrl est enfoncee, on zoome / dezoome
|
||||
if (e -> modifiers() & Qt::ControlModifier) {
|
||||
if (e -> delta() > 0) {
|
||||
if (e -> angleDelta().manhattanLength() > 0) {
|
||||
zoomIn();
|
||||
} else {
|
||||
zoomOut();
|
||||
|
||||
Reference in New Issue
Block a user