From 8cc4c24249600392871cc802f3ac4dd27368d335 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Mon, 18 Jan 2016 15:46:05 +0100 Subject: Added observer to update values displayed based on some metric. * Modified main() function to connect signals/slots to display calculated values * Color scales are no longer shared; they are also normalized to each component's own data * Stub mouse handling in BarChart (changes cursor shape) --- barchart.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'barchart.h') diff --git a/barchart.h b/barchart.h index e0edc0a..176f3b2 100644 --- a/barchart.h +++ b/barchart.h @@ -20,16 +20,17 @@ public: signals: void valuesChanged(const arma::vec &values) const; - void colorScaleChanged(const ColorScale *scale) const; + void colorScaleChanged(const ColorScale &scale) const; public slots: void setValues(const arma::vec &values); - void setColorScale(const ColorScale *scale); + void setColorScale(const ColorScale &scale); protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); void hoverMoveEvent(QHoverEvent *event); void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); private: QSGNode *newSceneGraph() const; @@ -42,7 +43,7 @@ private: bool m_shouldUpdateBars; arma::vec m_values; - const ColorScale *m_colorScale; + ColorScale m_colorScale; std::vector m_originalIndices; LinearScale m_scale; }; -- cgit v1.2.3