From 8132c8a4166496e82e8072695bc782604d2044d2 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 24 Nov 2022 11:31:49 +0100 Subject: [PATCH] render bug fixed --- examples/iotdashboard/DiagramSkinlet.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/examples/iotdashboard/DiagramSkinlet.cpp b/examples/iotdashboard/DiagramSkinlet.cpp index 46193e19..790ccf38 100644 --- a/examples/iotdashboard/DiagramSkinlet.cpp +++ b/examples/iotdashboard/DiagramSkinlet.cpp @@ -98,8 +98,6 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node const QRectF rect = diagram->subControlRect( Q::Chart ); const qreal yMax = diagram->yMax(); - const QVector< Diagram::Type > types = { Diagram::Line, Diagram::Area, Diagram::Bar }; - for( int i = 0; i < diagram->dataPoints().size(); ++i ) { QSGNode* chartNode; @@ -122,10 +120,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node int lineWidth = diagram->metric( lineSubcontrol | QskAspect::Size ); - for( int j = 0; j < types.size(); ++j ) + for( const auto type : { Diagram::Line, Diagram::Area, Diagram::Bar } ) { - const auto type = types.at( j ); - if( diagram->typesAt( i ) & type ) { QColor color; @@ -208,9 +204,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node dataPointNode->update( rect, nodeType, color, dataPoints, yMax, false, lineWidth ); } + nodeIndex++; } - - nodeIndex++; } while( nodeIndex < chartNode->childCount() )