From 0569ee0f1a277bcf18fc66f8e10a2d909ba9c66f Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 14 Nov 2011 16:03:29 -0500 Subject: [PATCH] Don't accept button press events as well as release when handling latches --- src/sourcetree/sourcedelegate.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sourcetree/sourcedelegate.cpp b/src/sourcetree/sourcedelegate.cpp index 3b8fc4152..5f059aebd 100644 --- a/src/sourcetree/sourcedelegate.cpp +++ b/src/sourcetree/sourcedelegate.cpp @@ -454,11 +454,15 @@ SourceDelegate::editorEvent ( QEvent* event, QAbstractItemModel* model, const QS // tDebug() << "CHECKING CLICK RECT:" << headphonesRect; if ( headphonesRect.contains( ev->pos() ) ) { - if ( index.data( SourcesModel::LatchedOnRole ).toBool() ) - // unlatch - emit latchOff( colItem->source() ); - else - emit latchOn( colItem->source() ); + if ( event->type() == QEvent::MouseButtonRelease ) + { + if ( index.data( SourcesModel::LatchedOnRole ).toBool() ) + // unlatch + emit latchOff( colItem->source() ); + else + emit latchOn( colItem->source() ); + } + return true; } } }