Skip to content

Commit

Permalink
Support Qt 5.15 (AcademySoftwareFoundation#2605)
Browse files Browse the repository at this point in the history
Homebrew upgrade to Qt 5.15 made it more urgent to change some
deprecated calls to newer idioms.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Jul 28, 2020
1 parent 1af8372 commit 2f55625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
### Optional dependencies -- features may be disabled if not found
* If you are building the `iv` viewer (which will be disabled if any of
these are not found):
* Qt >= 5.6
* Qt >= 5.6 (tested through 5.15)
* OpenGL
* If you are building the Python bindings or running the testsuite:
* Python >= 2.7 (tested against 2.7, 3.6, 3.7)
Expand Down
9 changes: 5 additions & 4 deletions src/iv/ivgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,14 +1227,15 @@ void
IvGL::wheelEvent(QWheelEvent* event)
{
m_mouse_activation = false;
if (event->orientation() == Qt::Vertical) {
// TODO: Update this to keep the zoom centered on the event .x, .y
QPoint angdelta = event->angleDelta() / 8; // div by 8 to get degrees
if (abs(angdelta.y()) > abs(angdelta.x()) // predominantly vertical
&& abs(angdelta.y()) > 2) { // suppress tiny motions
float oldzoom = m_viewer.zoom();
float newzoom = (event->delta() > 0) ? ceil2f(oldzoom)
: floor2f(oldzoom);
float newzoom = (angdelta.y() > 0) ? ceil2f(oldzoom) : floor2f(oldzoom);
m_viewer.zoom(newzoom);
event->accept();
}
// TODO: Update this to keep the zoom centered on the event .x, .y
}


Expand Down

0 comments on commit 2f55625

Please sign in to comment.