Skip to content

Commit

Permalink
doc: update DSwitchButton docs
Browse files Browse the repository at this point in the history
更新DSwitchButton控件的文档

Log: update docs
  • Loading branch information
chenchongbiao authored and xzl01 committed Apr 21, 2023
1 parent 359121f commit 0354aa6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
25 changes: 21 additions & 4 deletions docs/widgets/dswitchbutton.zh_CN.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,28 @@
@~chinese
@file dswitchbutton.h
@ingroup button
@class
@brief
@details

TODO: 添加类简介、示例代码、示例截图和函数使用说明等
@class Dtk::Widget::DSwitchButton
@brief DSwitchButton 实现一个开关按钮

@fn Dtk::Widget::DSwitchButton::DSwitchButton(QWidget *parent)
@brief 构造 DSwitchButton 对象,传入父控件指针。
@param parent 父控件指针

@fn QSize Dtk::Widget::DSwitchButton::sizeHint() const
@brief DSwitchButton::sizeHint 初始化控件矩形大小(在绘画之前)
@return 控件矩形大小

@fn void Dtk::Widget::DSwitchButton::paintEvent(QPaintEvent *e)
@brief DSwitchButton::paintEvent 绘画处理
@param e 绘画事件
@sa QWidget::paintEvent()

@fn void Dtk::Widget::DSwitchButton::initStyleOption(DStyleOptionButton *option) const
@brief DSwitchButton::initStyleOption 初始化(用于继承的)抽象按钮对象,后面用于 DStylePainter 绘画 DStyle::CE_SwitchButton 枚举
@param option 初始化了的的抽象风格按钮对象

@fn void Dtk::Widget::DSwitchButton::checkedChanged(bool arg)
@brief 选择状态的信号

*/
20 changes: 12 additions & 8 deletions src/widgets/dswitchbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
DWIDGET_BEGIN_NAMESPACE

/*!
\brief DSwitchButton::DSwitchButton 实现一个开关按钮
@~english
@brief DSwitchButton::DSwitchButton implements a switch button
\a parent
*/
DSwitchButton::DSwitchButton(QWidget *parent)
Expand All @@ -26,8 +27,9 @@ DSwitchButton::DSwitchButton(QWidget *parent)
}

/*!
\brief DSwitchButton::sizeHint 初始化控件矩形大小(在绘画之前)
\return 控件举行大小
@~english
@brief DSwitchButton::sizeHint initializes the control rectangle size (before drawing)
@return Control rectangle size
*/
QSize DSwitchButton::sizeHint() const
{
Expand All @@ -39,9 +41,10 @@ QSize DSwitchButton::sizeHint() const
}

/*!
\brief DSwitchButton::paintEvent 绘画处理
\a e 绘画事件
\sa QWidget::paintEvent()
@~english
@brief DSwitchButton::paintEvent Painting treatment
\a e Painting event
@sa QWidget::paintEvent()
*/
void DSwitchButton::paintEvent(QPaintEvent *e)
{
Expand All @@ -54,8 +57,9 @@ void DSwitchButton::paintEvent(QPaintEvent *e)
}

/*!
\brief DSwitchButton::initStyleOption 初始化(用于继承的)抽象按钮对象,后面用于 DStylePainter 绘画 DStyle::CE_SwitchButton 枚举
\a option 初始化了的的抽象风格按钮对象
@~english
@brief DSwitchButton::initStyleOption Initializes the abstract button object (for inheritance), which is later used for DStylePainter painting DStyle::CE_SwitchButton enumeration
\a option The abstract style button object is initialized
*/
void DSwitchButton::initStyleOption(DStyleOptionButton *option) const
{
Expand Down

0 comments on commit 0354aa6

Please sign in to comment.