aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--barchart.cpp7
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
}