DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dswitchbutton.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DSWITCHBUTTON_H
6#define DSWITCHBUTTON_H
7
8#include <QVariantAnimation>
9#include <QAbstractButton>
10
11#include <dtkwidget_global.h>
12#include <DObject>
13
14DWIDGET_BEGIN_NAMESPACE
15
16class DSwitchButtonPrivate;
17class DStyleOptionButton;
18class LIBDTKWIDGETSHARED_EXPORT DSwitchButton : public QAbstractButton, public DTK_CORE_NAMESPACE::DObject
19{
20 Q_OBJECT
21
22public:
23 explicit DSwitchButton(QWidget *parent = Q_NULLPTR);
24
25 QSize sizeHint() const Q_DECL_OVERRIDE;
26
27Q_SIGNALS:
28 void checkedChanged(bool arg);
29
30protected:
31 void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
32 void initStyleOption(DStyleOptionButton *option) const;
33 void checkStateSet() Q_DECL_OVERRIDE;
34
35private:
36 D_DECLARE_PRIVATE(DSwitchButton)
37};
38
39DWIDGET_END_NAMESPACE
40
41#endif // DSWITCHBUTTON_H
42
Dtk 样式统一的按钮样式配置.
Definition dstyleoption.h:58
DSwitchButton 实现一个开关按钮
Definition dswitchbutton.h:19
void checkedChanged(bool arg)
选择状态的信号