qskinny/examples/iot-dashboard/nodes/DiagramDataNode.h

42 lines
1.0 KiB
C
Raw Normal View History

2021-04-21 10:00:34 +00:00
/******************************************************************************
* QSkinny - Copyright (C) 2021 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
2021-04-21 09:26:39 +00:00
#ifndef DIAGRAMDATANODE_H
#define DIAGRAMDATANODE_H
2021-04-16 07:48:43 +00:00
#include <QskNamespace.h>
#include <QPolygonF>
#include <QSGFlatColorMaterial>
#include <QSGGeometryNode>
class IdlChartNode : public QSGGeometryNode
{
public:
enum Type
{
Line,
Area,
};
IdlChartNode();
void update( const QRectF& rect, Type type, const QColor& color, const QVector<QPointF>& dataPoints, const qreal yMax, Qsk::Position position, int lineWidth );
private:
QSGFlatColorMaterial m_material;
QSGGeometry m_geometry;
QRectF m_rect;
Type m_type;
QColor m_color;
QVector<QPointF> m_dataPoints;
qreal m_yMax;
Qsk::Position m_position;
int m_lineWidth;
};
2021-04-21 09:26:39 +00:00
#endif