From d414b68cea008edc063e26133564d120a7430bd2 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 21 Jan 2016 19:36:14 +0100 Subject: Added selection linking. Needs more tests. --- barchart.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'barchart.h') diff --git a/barchart.h b/barchart.h index d785aa9..d49c001 100644 --- a/barchart.h +++ b/barchart.h @@ -4,7 +4,6 @@ #include #include -#include #include @@ -22,11 +21,13 @@ public: signals: void valuesChanged(const arma::vec &values) const; void colorScaleChanged(const ColorScale &scale) const; - void selectionChanged(const QSet &selection) const; + void selectionChanged(const std::vector &selection) const; + void selectionInteractivelyChanged(const std::vector &selection) const; public slots: void setValues(const arma::vec &values); void setColorScale(const ColorScale &scale); + void setSelection(const std::vector &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 m_selection; + std::vector m_selection; + + int itemAt(float x, bool includeSelectorWidth = false) const; arma::vec m_values; ColorScale m_colorScale; -- cgit v1.2.3