Skip to content

Commit

Permalink
Only use QWheelEvent::position() for Qt>=5.14
Browse files Browse the repository at this point in the history
  • Loading branch information
jdtournier committed Jun 17, 2020
1 parent ad26ddd commit faf1469
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/mrview/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ namespace MR
namespace {

template <class Event> inline QPoint position (Event* event) { return event->pos(); }
template <> inline QPoint position (QWheelEvent* event) { return event->position().toPoint(); }
template <> inline QPoint position (QWheelEvent* event) {
#if QT_VERSION >= 0x050E00 // translates to 5.14.0
return event->position().toPoint();
#else
return event->pos().toPoint();
#endif
}

Qt::KeyboardModifiers get_modifier (const char* key, Qt::KeyboardModifiers default_key) {
std::string value = lowercase (MR::File::Config::get (key));
Expand Down

0 comments on commit faf1469

Please sign in to comment.