qskinny/src/controls/QskSpinBoxSkinlet.h

56 lines
1.6 KiB
C
Raw Normal View History

2023-02-17 11:01:56 +00:00
/******************************************************************************
2023-02-17 13:05:05 +00:00
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
2023-02-17 11:01:56 +00:00
*****************************************************************************/
2023-02-17 13:05:05 +00:00
#ifndef QSK_SPIN_BOX_SKINLET_H
#define QSK_SPIN_BOX_SKINLET_H
2023-02-17 11:01:56 +00:00
#include <QskSkinlet.h>
class QSK_EXPORT QskSpinBoxSkinlet : public QskSkinlet
{
2023-02-17 14:22:40 +00:00
Q_GADGET
using Inherited = QskSkinlet;
public:
2023-02-17 16:46:52 +00:00
Q_INVOKABLE QskSpinBoxSkinlet( QskSkin* = nullptr );
2023-02-17 14:22:40 +00:00
enum NodeRole
{
IncrementPanel,
DecrementPanel,
TextPanel,
IncrementIndicator,
DecrementIndicator,
Text,
RoleCount
2023-02-17 14:22:40 +00:00
};
QRectF subControlRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol ) const override;
QSizeF sizeHint( const QskSkinnable* skinnable,
Qt::SizeHint, const QSizeF& ) const override;
2023-02-17 16:46:52 +00:00
int sampleCount(
const QskSkinnable* skinnable, QskAspect::Subcontrol subControl ) const override;
QRectF sampleRect( const QskSkinnable* skinnable, const QRectF& rect,
QskAspect::Subcontrol subControl, int index ) const override;
QskAspect::States sampleStates( const QskSkinnable*,
QskAspect::Subcontrol, int index ) const override;
2023-02-17 16:46:52 +00:00
protected:
2023-02-17 16:46:52 +00:00
QSGNode* updateSubNode(
const QskSkinnable* skinnable, quint8 role, QSGNode* node ) const override;
QSGNode* updateSampleNode( const QskSkinnable*, QskAspect::Subcontrol,
2023-02-17 14:22:40 +00:00
int index, QSGNode* node ) const override;
2023-02-17 11:01:56 +00:00
};
2023-02-17 13:05:05 +00:00
#endif