DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dswitchlineexpand.h
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DSWITCHLINEEXPAND_H
6#define DSWITCHLINEEXPAND_H
7
8#include <QWidget>
9
10#include <dtkwidget_global.h>
11#include <ddrawer.h>
12#include <DSwitchButton>
13#include <dheaderline.h>
14
15DWIDGET_BEGIN_NAMESPACE
16
18{
19 Q_OBJECT
20public:
21 DSwitchHeaderLine(QWidget *parent = 0);
22 void setExpand(bool value);
23
24Q_SIGNALS:
25 void checkedChanged(bool arg);
26
27protected:
28 void mousePressEvent(QMouseEvent *);
29
30private:
31 void reverseArrowDirection();
32 DSwitchButton *m_switchButton = NULL;
33
34};
35
36class LIBDTKWIDGETSHARED_EXPORT DSwitchLineExpand : public DDrawer
37{
38 Q_OBJECT
39public:
40 explicit DSwitchLineExpand(QWidget *parent = 0);
41 void setTitle(const QString &title);
42 void setExpand(bool value);
43
44 DBaseLine *header();
45
46private:
47 void setHeader(QWidget *header);
48 void resizeEvent(QResizeEvent *e);
49
50private:
51 DSwitchHeaderLine *m_headerLine = NULL;
52};
53
54DWIDGET_END_NAMESPACE
55
56#endif // DSWITCHLINEEXPAND_H
可以使用 DBaseLine 类快速创建具有位于左右两侧的两个控件的行控件.
Definition dbaseline.h:18
A beautifully developed control.
Definition ddrawer.h:13
void setHeader(QWidget *header)
Set the title control The title control will always be displayed in the layout header Title control
Definition ddrawer.cpp:132
virtual void setExpand(bool value)
Set the visibility of the content control.
Definition ddrawer.cpp:202
可以使用 DHeaderLine 类快速创建标题行控件.
Definition dheaderline.h:17
DSwitchButton 实现一个开关按钮
Definition dswitchbutton.h:19
DSwitchHeaderLine 类用于提供 DSwitchLineExpand 的标题栏.
Definition dswitchlineexpand.h:18
void checkedChanged(bool arg)
信号在控件开关状态发生改变时触发. arg checked状态
DSwitchLineExpand 类提供了一种通过开关按钮来展开/合上显示内容的控件.
Definition dswitchlineexpand.h:37