diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-21 19:36:14 +0100 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-21 19:36:14 +0100 |
commit | d414b68cea008edc063e26133564d120a7430bd2 (patch) | |
tree | 7ae861a100d0b1560294b646014743dcd785ab4b /barchart.h | |
parent | e9d14f93498832687cbdbeb79748f9030e49fb2f (diff) |
Added selection linking. Needs more tests.
Diffstat (limited to 'barchart.h')
-rw-r--r-- | barchart.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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; |