diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-07 15:29:20 +0100 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-07 15:29:20 +0100 |
commit | 04f9105bc10cd978adfcdce7a46673e1dc531c82 (patch) | |
tree | a0d6cbc990fc6976b7e45172e2d00ea310939afd | |
parent | 7676a38ea8a06d3d31228cb7eb1be00f90de46d3 (diff) |
BarChart: fixed signed/unsigned comparisons.
-rw-r--r-- | barchart.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/barchart.cpp b/barchart.cpp index 02509ae..b0a367c 100644 --- a/barchart.cpp +++ b/barchart.cpp @@ -95,12 +95,13 @@ QSGNode *BarChart::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { QSGNode *root = oldNode ? oldNode : new QSGNode; if (m_shouldUpdateBars) { + int numValues = (int) m_values.n_elem; // First, make sure we have the same number of values & bars - while (m_values.n_elem > root->childCount()) { + while (numValues > root->childCount()) { QSGNode *barNode = newBarNode(); root->appendChildNode(barNode); } - while (m_values.n_elem < root->childCount()) { + while (numValues < root->childCount()) { // NOTE: as stated in docs, QSGNode's children are stored in a // linked list. Hence, this operation should be as fast as expected root->removeChildNode(root->firstChild()); @@ -116,8 +117,10 @@ QSGNode *BarChart::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) void BarChart::hoverMoveEvent(QHoverEvent *event) { + // TODO } void BarChart::mousePressEvent(QMouseEvent *event) { + // TODO } |