From 1f203a10f9fa30910ebf9cf286a8c064bf45c16e Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 7 Jan 2014 23:49:07 +0100 Subject: [PATCH] Widgets/Knob: only restore journalling state on release of left mouse button Do not try to restore the journalling state of the underlying model when releasing e.g the right mouse button as this causes a crash otherwise. --- src/gui/widgets/knob.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 9f6840349..333925106 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -488,9 +488,16 @@ void knob::mouseMoveEvent( QMouseEvent * _me ) -void knob::mouseReleaseEvent( QMouseEvent * /* _me*/ ) +void knob::mouseReleaseEvent( QMouseEvent* event ) { - model()->restoreJournallingState(); + if( event && event->button() == Qt::LeftButton ) + { + AutomatableModel *thisModel = model(); + if( thisModel ) + { + thisModel->restoreJournallingState(); + } + } m_buttonPressed = false;