aboutsummaryrefslogtreecommitdiff
path: root/barchart.h
diff options
context:
space:
mode:
Diffstat (limited to 'barchart.h')
-rw-r--r--barchart.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/barchart.h b/barchart.h
index d785aa9..d49c001 100644
--- a/barchart.h
+++ b/barchart.h
@@ -4,7 +4,6 @@
#include <vector>
#include <QtQuick>
-#include <QSet>
#include <armadillo>
@@ -22,11 +21,13 @@ public:
signals:
void valuesChanged(const arma::vec &values) const;
void colorScaleChanged(const ColorScale &scale) const;
- void selectionChanged(const QSet<int> &selection) const;
+ void selectionChanged(const std::vector<bool> &selection) const;
+ void selectionInteractivelyChanged(const std::vector<bool> &selection) const;
public slots:
void setValues(const arma::vec &values);
void setColorScale(const ColorScale &scale);
+ void setSelection(const std::vector<bool> &selection);
protected:
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
@@ -53,9 +54,11 @@ private:
void updateSelectionRect(QSGNode *node);
bool m_shouldUpdateSelectionRect;
- void selectBarsInRange(float start, float end);
+ void interactiveSelection(float start, float end);
float m_dragStartPos, m_dragLastPos;
- QSet<int> m_selection;
+ std::vector<bool> m_selection;
+
+ int itemAt(float x, bool includeSelectorWidth = false) const;
arma::vec m_values;
ColorScale m_colorScale;