From 04f9105bc10cd978adfcdce7a46673e1dc531c82 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 7 Jan 2016 15:29:20 +0100 Subject: BarChart: fixed signed/unsigned comparisons. --- barchart.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'barchart.cpp') 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 } -- cgit v1.2.3