aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-02-18 12:16:07 -0200
committerSamuel Fadel <samuelfadel@gmail.com>2016-02-18 12:16:07 -0200
commit0eff4cb305b716b5a9a6a29aa53e617c8923c22d (patch)
treef4ff312d5ba6f2a51c8200d055e1dc58f9c8ec2c
parent5bd1fec462466d605f974fa27c3b00826a1bab57 (diff)
Scatterplot: constants for mouse buttons.
-rw-r--r--scatterplot.cpp8
1 files changed, 6 insertions, 2 deletions
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);