diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-02-28 21:49:04 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-02-28 21:49:04 -0300 |
commit | aeb79d03ee960a12b7b9602bc9392b840711764b (patch) | |
tree | 3e0a0bdd8c38fa448e015a45fa0d6a13f35a3a0d | |
parent | d3d3526bab2ab051656a1b80b4e0f1337037b5de (diff) | |
parent | 0eff4cb305b716b5a9a6a29aa53e617c8923c22d (diff) |
Merge branch 'master' of bitbucket.org:fadel/pm
-rw-r--r-- | scatterplot.cpp | 8 |
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); |