aboutsummaryrefslogtreecommitdiff
path: root/barchart.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-21 14:49:12 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-21 14:49:12 +0100
commit664dc43127bf0dc5791423898ffab6748f016dd7 (patch)
treed0d2c5d54379c6569d5464cee2ae6b706d4ca20a /barchart.h
parentb019d016da8c645fcc581dd170df821c4fec079c (diff)
BarChart: added selection mechanisms.
Diffstat (limited to 'barchart.h')
-rw-r--r--barchart.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/barchart.h b/barchart.h
index 91cce78..d785aa9 100644
--- a/barchart.h
+++ b/barchart.h
@@ -4,6 +4,7 @@
#include <vector>
#include <QtQuick>
+#include <QSet>
#include <armadillo>
@@ -21,6 +22,7 @@ public:
signals:
void valuesChanged(const arma::vec &values) const;
void colorScaleChanged(const ColorScale &scale) const;
+ void selectionChanged(const QSet<int> &selection) const;
public slots:
void setValues(const arma::vec &values);
@@ -49,6 +51,12 @@ private:
bool m_shouldUpdateBars;
float m_hoverPos;
+ void updateSelectionRect(QSGNode *node);
+ bool m_shouldUpdateSelectionRect;
+ void selectBarsInRange(float start, float end);
+ float m_dragStartPos, m_dragLastPos;
+ QSet<int> m_selection;
+
arma::vec m_values;
ColorScale m_colorScale;
std::vector<int> m_originalIndices;