From 5672e1affe3885fe74a4b55444f0ab0c989dbfcb Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 21 Mar 2012 11:08:14 +0100 Subject: [PATCH] Cocoa: improve mouse button tracking warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The warnings about "Internal mouse button tracking invalid" should check for the correct button before emitting a warning. The warning should also mention the correct button as well. For otherMouseDragged, we simply check for any button that's not the left or right button. Change-Id: I9eb6d6bd7fb5919e745b7f8eb517b4bc9efd36a6 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qnsview.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 52f40ea01c..d7f6310f6e 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -304,7 +304,7 @@ static QTouchDevice *touchDevice = 0; - (void)mouseDragged:(NSEvent *)theEvent { if (!(m_buttons & Qt::LeftButton)) - qWarning("Internal Mousebutton tracking invalid(missing Qt::LeftButton"); + qWarning("QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)"); [self handleMouseEvent:theEvent]; } @@ -339,8 +339,8 @@ static QTouchDevice *touchDevice = 0; - (void)rightMouseDragged:(NSEvent *)theEvent { - if (!(m_buttons & Qt::LeftButton)) - qWarning("Internal Mousebutton tracking invalid(missing Qt::LeftButton"); + if (!(m_buttons & Qt::RightButton)) + qWarning("QNSView rightMouseDragged: Internal mouse button tracking invalid (missing Qt::RightButton)"); [self handleMouseEvent:theEvent]; } @@ -404,8 +404,8 @@ static QTouchDevice *touchDevice = 0; - (void)otherMouseDragged:(NSEvent *)theEvent { - if (!(m_buttons & Qt::LeftButton)) - qWarning("Internal Mousebutton tracking invalid(missing Qt::LeftButton"); + if (!(m_buttons & ~(Qt::LeftButton | Qt::RightButton))) + qWarning("QNSView otherMouseDragged: Internal mouse button tracking invalid (missing Qt::MiddleButton or Qt::ExtraButton*)"); [self handleMouseEvent:theEvent]; }