From 0eff4cb305b716b5a9a6a29aa53e617c8923c22d Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 18 Feb 2016 12:16:07 -0200 Subject: Scatterplot: constants for mouse buttons. --- scatterplot.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scatterplot.cpp') diff --git a/scatterplot.cpp b/scatterplot.cpp index 0b3ef45..2d9af7a 100644 --- a/scatterplot.cpp +++ b/scatterplot.cpp @@ -31,6 +31,10 @@ static const QColor CROSSHAIR_COLOR2(0, 0, 0); // Selection settings static const QColor SELECTION_COLOR(128, 128, 128, 96); +// Mouse buttons +static const Qt::MouseButton NORMAL_BUTTON = Qt::LeftButton; +static const Qt::MouseButton SPECIAL_BUTTON = Qt::RightButton; + class QuadTree { public: @@ -546,7 +550,7 @@ void Scatterplot::mousePressEvent(QMouseEvent *event) case StateNone: case StateSelected: switch (event->button()) { - case Qt::LeftButton: + case NORMAL_BUTTON: if (event->modifiers() == Qt::ShiftModifier && m_dragEnabled) { m_interactionState = StateMoving; m_dragOriginPos = event->localPos(); @@ -555,7 +559,7 @@ void Scatterplot::mousePressEvent(QMouseEvent *event) m_interactionState = StateBrushing; } break; - case Qt::RightButton: + case SPECIAL_BUTTON: m_interactionState = StateNone; m_selection.assign(m_selection.size(), false); emit selectionInteractivelyChanged(m_selection); -- cgit v1.2.3