DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dcoloredprogressbar.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#include <dtkwidget_global.h>
6#include <DObject>
7
8#include <QProgressBar>
9
10DWIDGET_BEGIN_NAMESPACE
11
12class DColoredProgressBarPrivate;
13class LIBDTKWIDGETSHARED_EXPORT DColoredProgressBar : public QProgressBar, public DTK_CORE_NAMESPACE::DObject
14{
15 Q_OBJECT
16public:
17 explicit DColoredProgressBar(QWidget *parent = nullptr);
18 void addThreshold(int threshold, QBrush brush);
19 void removeThreshold(int threshold);
20 QList<int> thresholds() const;
21
22protected:
23 void paintEvent(QPaintEvent *) override;
24
25private:
26 D_DECLARE_PRIVATE(DColoredProgressBar)
27};
28
29DWIDGET_END_NAMESPACE
DColoredProgressBar和QProgressBar功能差不多一样,只是它可以根据显示的值更改其外观
Definition dcoloredprogressbar.h:14
void addThreshold(int threshold, QBrush brush)
DColoredProgressBar::addThreshold添加一个新的阈值,并指定达到该值后要使用的画笔。如果一个相同值的阈值已经存在,它将被覆盖。