Skip to content

Commit

Permalink
doc: update docs for dprogressbar
Browse files Browse the repository at this point in the history
更新dprogressbar的文档

Log: update docs

Issue: linuxdeepin/dtk#94
  • Loading branch information
LEpoii authored and kegechen committed Jul 14, 2023
1 parent ac719a9 commit 105bbee
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
Binary file added docs/images/DProgressBar_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/DProgressBar_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 15 additions & 4 deletions docs/widgets/dprogressbar.zh_CN.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@
@~chinese
@file dprogressbar.h
@ingroup dprogressbar
@class
@brief
@details
@class Dtk::Widget::DProgressBar
@brief 继承自 QProgressBar类 ,一个用于表示进度条的控件
@details DProgressBar类 继承自 QProgressBar类, 提供展现进度条的功能

TODO: 添加类简介、示例代码、示例截图和函数使用说明等
@image html ../images/DProgressBar_1.png
@image html ../images/DProgressBar_2.png

@fn DProgressBar::DProgressBar(QWidget *parent)
@brief DProgressBar 的构造函数
@param[in] parent 父构件 QProgressBar 对象

@fn QSize DProgressBar::sizeHint() const
@brief 与QProgressBar::sizeHint()类似,返回进度条的推荐大小
@return 进度条的推荐大小

@fn QSize DProgressBar::minimumSizeHint() const
@brief 与DProgressBar::minimumSizeHint()类似,返回进度条的最小推荐大小
@return 进度条的最小推荐大小
*/
24 changes: 23 additions & 1 deletion src/widgets/dprogressbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,30 @@
#include <QStyleOptionProgressBar>

DWIDGET_BEGIN_NAMESPACE

/*!
@~english
@class Dtk::Widget::DProgressBar
@brief DProgressBar is a widget for progress bar
@details The DProgressBar Class inherits from The QProgressBar Class and provides the function of displaying progress bar.
*/

/*!
@~english
@brief DProgressBar constructor.
@param[in] parent is passed to QProgressBar constructor.
*/
DProgressBar::DProgressBar(QWidget *parent)
: QProgressBar(parent)
{

}

/*!
@~english
@brief similar to QProgressBar::sizeHint(),return the siezehint of progress bar
@return sizehint of the progress bar
*/
QSize DProgressBar::sizeHint() const
{
if (isTextVisible()) {
Expand All @@ -26,6 +43,11 @@ QSize DProgressBar::sizeHint() const
return style()->sizeFromContents(QStyle::CT_ProgressBar, &opt, QSize(1, 1), this);
}

/*!
@~english
@brief similar to QProgressBar::minimumSizeHint(),return the minimum siezehint of progress bar
@return minimum sizehint of the progress bar
*/
QSize DProgressBar::minimumSizeHint() const
{
if (isTextVisible()) {
Expand Down

0 comments on commit 105bbee

Please sign in to comment.