DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dframe.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DFRAME_H
6#define DFRAME_H
7
8#include <dtkwidget_global.h>
9#include <DPalette>
10#include <DObject>
11
12#include <QFrame>
13
14DWIDGET_BEGIN_NAMESPACE
15
16class DFramePrivate;
17class DFrame : public QFrame, public DCORE_NAMESPACE::DObject
18{
19 Q_OBJECT
20 D_DECLARE_PRIVATE(DFrame)
21
22public:
23 explicit DFrame(QWidget *parent = nullptr);
24
25 void setFrameRounded(bool on);
26 void setBackgroundRole(DGUI_NAMESPACE::DPalette::ColorType type);
27 using QFrame::setBackgroundRole;
28
29protected:
30 DFrame(DFramePrivate &dd, QWidget *parent = nullptr);
31
32 void paintEvent(QPaintEvent *event) override;
33};
34
35class DHorizontalLine : public QFrame
36{
37 Q_OBJECT
38public:
39 explicit DHorizontalLine(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags())
40 : QFrame(parent, f)
41 {
42 setFrameShape(HLine);
43 }
44};
45
46class DVerticalLine : public QFrame
47{
48 Q_OBJECT
49public:
50 explicit DVerticalLine(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags())
51 : QFrame(parent, f)
52 {
53 setFrameShape(VLine);
54 }
55};
56
57DWIDGET_END_NAMESPACE
58
59#endif // DFRAME_H
Definition dframe_p.h:17
继承自QFrame类, 支持设置边框圆角,背景画刷功能
Definition dframe.h:18
Definition dframe.h:36
Definition dframe.h:47