qskinny/examples/iot-dashboard/PieChartSkinlet.h

32 lines
742 B
C
Raw Normal View History

2020-05-22 13:15:38 +00:00
#ifndef PIECHARTSKINLET_H
#define PIECHARTSKINLET_H
#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
};
#endif // PIECHARTSKINLET_H