DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dcircleprogress.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DCIRCLEPROGRESS_H
6#define DCIRCLEPROGRESS_H
7
8#include <dtkwidget_global.h>
9#include <DThemeManager>
10#include <DObject>
11
12#include <QWidget>
13#include <QLabel>
14#include <QPixmap>
15
16DWIDGET_BEGIN_NAMESPACE
17
18class DCircleProgressPrivate;
19class LIBDTKWIDGETSHARED_EXPORT DCircleProgress : public QWidget, public DTK_CORE_NAMESPACE::DObject
20{
21 Q_OBJECT
22 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE true)
23 Q_PROPERTY(QColor chunkColor READ chunkColor WRITE setChunkColor DESIGNABLE true)
24 Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth DESIGNABLE true)
25
26Q_SIGNALS:
27 void clicked();
30
31public:
32 explicit DCircleProgress(QWidget *parent = 0);
33
34 int value() const;
35 void setValue(int value);
36
37 const QString text() const;
38 void setText(const QString &text);
39
40 const QColor backgroundColor() const;
41 void setBackgroundColor(const QColor &color);
42
43 const QColor chunkColor() const;
44 void setChunkColor(const QColor &color);
45
46 int lineWidth() const;
47 void setLineWidth(const int width);
48
49 QLabel *topLabel();
50 QLabel *bottomLabel();
51
52Q_SIGNALS:
53 void valueChanged(const int value) const;
54
55protected:
56 void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
57 void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
58#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
59 void enterEvent(QEvent *e) Q_DECL_OVERRIDE;
60#else
61 void enterEvent(QEnterEvent *e) Q_DECL_OVERRIDE;
62#endif
63 void leaveEvent(QEvent *e) Q_DECL_OVERRIDE;
64
65private:
66 D_DECLARE_PRIVATE(DCircleProgress)
67};
68
69DWIDGET_END_NAMESPACE
70
71#endif // DCIRCLEPROGRESS_H
可以使用 DCircleProgress 类快速创建环形进度条控件. DCircleProgress 提供了一个可控制颜色并可以包含文字显示的环形进度条控件。可以快速创建底色为 backgroundCo...
Definition dcircleprogress.h:20