2019-06-20 10:02:28 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the 3-clause BSD License
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-04-05 09:23:38 +00:00
|
|
|
#ifndef SPEEDOMETERSKINLET_H
|
|
|
|
#define SPEEDOMETERSKINLET_H
|
|
|
|
|
|
|
|
#include <QskSkinlet.h>
|
|
|
|
|
|
|
|
class Speedometer;
|
|
|
|
|
|
|
|
class SpeedometerSkinlet : public QskSkinlet
|
|
|
|
{
|
|
|
|
Q_GADGET
|
|
|
|
|
2018-08-03 06:15:28 +00:00
|
|
|
public:
|
2018-04-05 09:23:38 +00:00
|
|
|
enum NodeRole
|
|
|
|
{
|
|
|
|
PanelRole,
|
2018-04-05 09:23:52 +00:00
|
|
|
LabelsRole,
|
2020-12-18 15:32:54 +00:00
|
|
|
KnobRole,
|
2018-04-05 09:23:38 +00:00
|
|
|
NeedleRole
|
|
|
|
};
|
|
|
|
|
|
|
|
Q_INVOKABLE SpeedometerSkinlet( QskSkin* skin = nullptr );
|
|
|
|
|
2019-04-25 12:23:39 +00:00
|
|
|
QRectF subControlRect( const QskSkinnable*,
|
|
|
|
const QRectF&, QskAspect::Subcontrol ) const override;
|
2018-04-05 09:23:38 +00:00
|
|
|
|
2018-08-03 06:15:28 +00:00
|
|
|
protected:
|
|
|
|
virtual QSGNode* updateSubNode( const QskSkinnable*,
|
|
|
|
quint8 nodeRole, QSGNode* node ) const override;
|
2018-04-05 09:23:38 +00:00
|
|
|
|
2018-08-03 06:15:28 +00:00
|
|
|
private:
|
2020-12-18 15:32:54 +00:00
|
|
|
QRectF scaleRect( const Speedometer* ) const;
|
|
|
|
QLineF needlePoints( const Speedometer* ) const;
|
|
|
|
|
2018-04-05 09:23:52 +00:00
|
|
|
QSGNode* updateLabelsNode( const Speedometer*, QSGNode* ) const;
|
2018-04-05 09:23:38 +00:00
|
|
|
QSGNode* updateNeedleNode( const Speedometer*, QSGNode* ) const;
|
|
|
|
};
|
|
|
|
|
2018-07-31 15:32:25 +00:00
|
|
|
#endif
|