qskinny/src/controls/QskSwitchButton.h

52 lines
1.3 KiB
C
Raw Normal View History

2024-01-17 13:31:45 +00:00
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
2021-08-02 11:22:37 +00:00
#ifndef QSK_SWITCH_BUTTON_H
#define QSK_SWITCH_BUTTON_H
#include "QskAbstractButton.h"
2021-08-02 17:17:04 +00:00
#include <qnamespace.h>
2021-08-02 11:22:37 +00: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 17:17:04 +00:00
Q_PROPERTY( bool inverted READ isInverted
WRITE setInverted NOTIFY invertedChanged FINAL )
2021-08-02 11:22:37 +00:00
public:
2021-08-27 07:09:10 +00:00
QSK_SUBCONTROLS( Groove, Handle, Ripple )
2021-08-02 11:22:37 +00:00
2021-08-02 17:17:04 +00:00
QskSwitchButton( Qt::Orientation, QQuickItem* parent = nullptr );
2021-08-02 11:22:37 +00:00
QskSwitchButton( QQuickItem* parent = nullptr );
2021-08-02 17:17:04 +00:00
2021-08-02 11:22:37 +00:00
~QskSwitchButton() override;
2021-08-06 07:52:12 +00:00
bool isCheckable() const override final;
2021-08-02 11:22:37 +00:00
Qt::Orientation orientation() const;
void setOrientation(Qt::Orientation);
2021-08-02 17:17:04 +00:00
bool isInverted() const;
void setInverted( bool );
QskAspect::Variation effectiveVariation() const override;
2021-08-02 11:22:37 +00:00
Q_SIGNALS:
void orientationChanged( Qt::Orientation );
2021-08-02 17:17:04 +00:00
void invertedChanged( bool );
2021-08-02 11:22:37 +00:00
private:
struct PrivateData;
std::unique_ptr< PrivateData > m_data;
};
2021-08-02 17:17:04 +00:00
2021-08-02 11:22:37 +00:00
#endif