From 09ea9cace4286c639044aef79f2deb107c2a5376 Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Thu, 23 Feb 2012 11:57:18 +1000 Subject: Fix for bad operator precedence causing right mouse button issues Binary or (|) has higher operator precedence than a ternary in C, causing the original expression here to function quite incorrectly for anything other than the common left-mouse-button-only case. I just added brackets -- feel free to change this to "if"s if you think that would more clearly avoid this issue in future. Change-Id: Ie20bd7e805b89a393794d3240fb0ae680b29ff64 Reviewed-by: Andrew den Exter --- src/quick/items/qquickitem_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index c2cc7d000b..fd02334ab3 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -830,8 +830,8 @@ private: Qt::MouseButtons QQuickItemPrivate::acceptedMouseButtons() const { - return extra.flag()?Qt::LeftButton:Qt::MouseButton(0) | - (extra.isAllocated()?extra->acceptedMouseButtons:Qt::MouseButtons(0)); + return ((extra.flag() ? Qt::LeftButton : Qt::MouseButton(0)) | + (extra.isAllocated() ? extra->acceptedMouseButtons : Qt::MouseButtons(0))); } QSGContext *QQuickItemPrivate::sceneGraphContext() const -- cgit v1.2.3