QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSwitchButton.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SWITCH_BUTTON_H
7#define QSK_SWITCH_BUTTON_H
8
9#include "QskAbstractButton.h"
10#include <qnamespace.h>
11
12class QSK_EXPORT QskSwitchButton : public QskAbstractButton
13{
14 Q_OBJECT
15
17
18 Q_PROPERTY( Qt::Orientation orientation READ orientation
19 WRITE setOrientation NOTIFY orientationChanged FINAL )
20
21 Q_PROPERTY( bool inverted READ isInverted
22 WRITE setInverted NOTIFY invertedChanged FINAL )
23
24 Q_PROPERTY( IconMode iconMode READ iconMode
25 WRITE setIconMode NOTIFY iconModeChanged FINAL )
26
27 public:
28 QSK_SUBCONTROLS( Groove, Handle, Icon )
29
30 enum IconMode
31 {
32 NoIcon,
33 ShowIconWhenSelected,
34 ShowIconAlways
35 };
36 Q_ENUM( IconMode )
37
38 QskSwitchButton( Qt::Orientation, QQuickItem* parent = nullptr );
39 QskSwitchButton( QQuickItem* parent = nullptr );
40
41 ~QskSwitchButton() override;
42
43 bool isCheckable() const override final;
44
45 Qt::Orientation orientation() const;
46 void setOrientation( Qt::Orientation );
47
48 bool isInverted() const;
49 void setInverted( bool );
50
51 IconMode iconMode() const;
52 void setIconMode( IconMode );
53
55
56 Q_SIGNALS:
57 void orientationChanged( Qt::Orientation );
58 void invertedChanged( bool );
59 void iconModeChanged( IconMode );
60
61 private:
62 struct PrivateData;
63 std::unique_ptr< PrivateData > m_data;
64};
65
66#endif
Variation
Some sort of variation.
Definition QskAspect.h:82
virtual QskAspect::Variation effectiveVariation() const