Skip to content

Commit

Permalink
Cocoa QPA: Mute mouse dragging warnings
Browse files Browse the repository at this point in the history
While probably valid, these warnings are beyond the
user's control, and more likely a sign of Qt's own
expectations or misbehavior. So, we should not annoy
the users with them.

This change introduces the same logging category as
3ee01f7 in 5.7 as is a partial backport to
simplify a subsequent 5.6 to 5.7 merge.

Change-Id: Ica2e3b1c5bc372923fd823b5d7d537d319835685
Task-number: QTBUG-42846
Reviewed-by: Timur Pocheptsov <[email protected]>
  • Loading branch information
Gabriel de Dietrich authored and Timur Pocheptsov committed Jun 4, 2016
1 parent 2266748 commit cf19b06
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/plugins/platforms/cocoa/qcocoahelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

QT_BEGIN_NAMESPACE

Q_DECLARE_LOGGING_CATEGORY(lcQpaCocoaWindow)

class QPixmap;
class QString;

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/cocoa/qcocoahelpers.mm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

QT_BEGIN_NAMESPACE

Q_LOGGING_CATEGORY(lcQpaCocoaWindow, "qt.qpa.cocoa.window");

//
// Conversion Functions
//
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/platforms/cocoa/qnsview.mm
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ - (void)mouseDragged:(NSEvent *)theEvent
if (m_window && (m_window->flags() & Qt::WindowTransparentForInput) )
return [super mouseDragged:theEvent];
if (!(m_buttons & (m_sendUpAsRightButton ? Qt::RightButton : Qt::LeftButton)))
qWarning("QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)");
qCDebug(lcQpaCocoaWindow, "QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)");
[self handleMouseEvent:theEvent];
}

Expand Down Expand Up @@ -1019,7 +1019,7 @@ - (void)rightMouseDragged:(NSEvent *)theEvent
if (m_window && (m_window->flags() & Qt::WindowTransparentForInput) )
return [super rightMouseDragged:theEvent];
if (!(m_buttons & Qt::RightButton))
qWarning("QNSView rightMouseDragged: Internal mouse button tracking invalid (missing Qt::RightButton)");
qCDebug(lcQpaCocoaWindow, "QNSView rightMouseDragged: Internal mouse button tracking invalid (missing Qt::RightButton)");
[self handleMouseEvent:theEvent];
}

Expand All @@ -1045,7 +1045,7 @@ - (void)otherMouseDragged:(NSEvent *)theEvent
if (m_window && (m_window->flags() & Qt::WindowTransparentForInput) )
return [super otherMouseDragged:theEvent];
if (!(m_buttons & ~(Qt::LeftButton | Qt::RightButton)))
qWarning("QNSView otherMouseDragged: Internal mouse button tracking invalid (missing Qt::MiddleButton or Qt::ExtraButton*)");
qCDebug(lcQpaCocoaWindow, "QNSView otherMouseDragged: Internal mouse button tracking invalid (missing Qt::MiddleButton or Qt::ExtraButton*)");
[self handleMouseEvent:theEvent];
}

Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/cocoa/qt_mac_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "QtCore/qvariant.h"
#include "QtCore/qmimedata.h"
#include "QtCore/qpointer.h"
#include "QtCore/qloggingcategory.h"
#include "private/qcore_mac_p.h"


Expand Down

0 comments on commit cf19b06

Please sign in to comment.