qskinny/examples/iot-dashboard/PieChartSkinlet.h

32 lines
745 B
C
Raw Normal View History

2021-04-21 09:26:39 +00:00
#ifndef PIECHART_SKINLET_H
#define PIECHART_SKINLET_H
2020-05-22 13:15:38 +00:00
#include <QskSkinlet.h>
class PieChart;
class PieChartSkinlet : public QskSkinlet
{
2021-03-26 08:45:33 +00:00
Q_GADGET
2020-05-22 13:15:38 +00:00
2021-03-26 08:45:33 +00:00
public:
enum NodeRole
{
PanelRole,
LabelsRole
};
2020-05-22 13:15:38 +00:00
2021-03-26 08:45:33 +00:00
Q_INVOKABLE PieChartSkinlet( QskSkin* skin = nullptr );
2020-05-22 13:15:38 +00:00
2021-03-26 08:45:33 +00:00
QRectF subControlRect( const QskSkinnable*, const QRectF&, QskAspect::Subcontrol ) const override;
2020-05-22 13:15:38 +00:00
2021-03-26 08:45:33 +00:00
protected:
virtual QSGNode* updateSubNode( const QskSkinnable*, quint8 nodeRole, QSGNode* node ) const override;
2020-05-22 13:15:38 +00:00
2021-03-26 08:45:33 +00:00
private:
QSGNode* updatePanelNode( const PieChart*, QSGNode* ) const;
QSGNode* updateLabelsNode( const PieChart*, QSGNode* ) const;
2020-05-22 13:15:38 +00:00
};
2021-04-21 09:26:39 +00:00
#endif // PIECHART_SKINLET_H