diff --git a/eventmodel.cpp b/eventmodel.cpp index 2c4f0bed4..121222296 100644 --- a/eventmodel.cpp +++ b/eventmodel.cpp @@ -1027,6 +1027,21 @@ void EventModel::handleKeyboard(QKeyEvent *event, int VPfound) { } } +void EventModel::handleKeyRelease(QKeyEvent *event) { + if (event->key() == Qt::Key_5) { // switch between compresed and raw + static uint originalCompressionRatio; + static bool changeToRaw = false; + changeToRaw = !changeToRaw; + if (changeToRaw) { + originalCompressionRatio = state->compressionRatio; + state->compressionRatio = 0; + } else { + state->compressionRatio = originalCompressionRatio; + } + state->viewer->changeDatasetMag(DATA_SET); + } +} + Coordinate *EventModel::getCoordinateFromOrthogonalClick(QMouseEvent *event, int VPfound) { Coordinate *foundCoordinate; diff --git a/eventmodel.h b/eventmodel.h index 29f005244..cb514ea91 100644 --- a/eventmodel.h +++ b/eventmodel.h @@ -63,6 +63,7 @@ class EventModel : public QObject void handleMouseReleaseMiddle(QMouseEvent *event, int VPfound); void handleMouseWheel(QWheelEvent * const event, int VPfound); void handleKeyboard(QKeyEvent *event, int VPfound); + void handleKeyRelease(QKeyEvent *event); static Coordinate *getCoordinateFromOrthogonalClick(QMouseEvent *event, int VPfound); void startNodeSelection(int x, int y, int vpId); diff --git a/widgets/viewport.cpp b/widgets/viewport.cpp index 4ece86d02..0a9dc9e6e 100644 --- a/widgets/viewport.cpp +++ b/widgets/viewport.cpp @@ -444,6 +444,8 @@ void Viewport::keyReleaseEvent(QKeyEvent *event) { state->repeatDirection[0] /= 10; state->repeatDirection[1] /= 10; state->repeatDirection[2] /= 10; + } else { + eventDelegate->handleKeyRelease(event); } }