qskinny/src/controls/QskSwitchButton.h

47 lines
1.1 KiB
C
Raw Normal View History

2021-08-02 13:22:37 +02:00
#ifndef QSK_SWITCH_BUTTON_H
#define QSK_SWITCH_BUTTON_H
#include "QskAbstractButton.h"
2021-08-02 19:17:04 +02:00
#include <qnamespace.h>
2021-08-02 13:22:37 +02:00
class QSK_EXPORT QskSwitchButton : public QskAbstractButton
{
Q_OBJECT
using Inherited = QskAbstractButton;
Q_PROPERTY( Qt::Orientation orientation READ orientation
WRITE setOrientation NOTIFY orientationChanged FINAL )
2021-08-02 19:17:04 +02:00
Q_PROPERTY( bool inverted READ isInverted
WRITE setInverted NOTIFY invertedChanged FINAL )
2021-08-02 13:22:37 +02:00
public:
2021-08-27 09:09:10 +02:00
QSK_SUBCONTROLS( Groove, Handle, Ripple )
2021-08-02 13:22:37 +02:00
2021-08-02 19:17:04 +02:00
QskSwitchButton( Qt::Orientation, QQuickItem* parent = nullptr );
2021-08-02 13:22:37 +02:00
QskSwitchButton( QQuickItem* parent = nullptr );
2021-08-02 19:17:04 +02:00
2021-08-02 13:22:37 +02:00
~QskSwitchButton() override;
2021-08-06 09:52:12 +02:00
bool isCheckable() const override final;
2021-08-02 13:22:37 +02:00
Qt::Orientation orientation() const;
void setOrientation(Qt::Orientation);
2021-08-02 19:17:04 +02:00
bool isInverted() const;
void setInverted( bool );
QskAspect::Placement effectivePlacement() const override;
2021-08-02 13:22:37 +02:00
Q_SIGNALS:
void orientationChanged( Qt::Orientation );
2021-08-02 19:17:04 +02:00
void invertedChanged( bool );
2021-08-02 13:22:37 +02:00
private:
struct PrivateData;
std::unique_ptr< PrivateData > m_data;
};
2021-08-02 19:17:04 +02:00
2021-08-02 13:22:37 +02:00
#endif