aboutsummaryrefslogtreecommitdiff
path: root/barchart.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-18 15:46:05 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-18 15:46:05 +0100
commit8cc4c24249600392871cc802f3ac4dd27368d335 (patch)
tree9bfde6414953828b379ee3728f5d92bbb772558d /barchart.h
parentd0ba4bbd9eb7b550cf71bb421e2a6f8b83018b48 (diff)
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)
Diffstat (limited to 'barchart.h')
-rw-r--r--barchart.h7
1 files changed, 4 insertions, 3 deletions
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<int> m_originalIndices;
LinearScale<float> m_scale;
};