Skip to content

Commit

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

Log: update docs

Issue: linuxdeepin/dtk#94
  • Loading branch information
LEpoii committed Jul 5, 2023
1 parent e054ff1 commit 688f3ed
Show file tree
Hide file tree
Showing 2 changed files with 224 additions and 78 deletions.
130 changes: 126 additions & 4 deletions docs/widgets/dbuttonbox.zh_CN.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,133 @@
@~chinese
@file dbuttonbox.h
@ingroup button
@class
@brief
@details
@class Dtk::Widget::DButtonBoxButton
@brief DButtonBoxButton 提供了修改了样式的按钮.
@details DButtonBoxButton 提供了设置图标的按钮的函数
@code 代码示例
DButtonBoxButton *btn1 = new DButtonBoxButton("btn1");
btn1->setIcon(QStyle::StandardPixmap::SP_ArrowUp);
@endcode
@image html DButtonBoxButton.png
@sa Dtk::Widget::DButtonBox

TODO: 添加类简介、示例代码、示例截图和函数使用说明等
@fn DButtonBoxButton::DButtonBoxButton(const QString &text, QWidget *parent)
@brief DButtonBoxButton 构造函数.
@param[in] text 按钮名称
@param[in] parent 参数被发送到 QAbstractButton 构造函数


@fn DButtonBoxButton::DButtonBoxButton(const QIcon &icon, const QString &text, QWidget *parent)
@brief DButtonBoxButton构造函数.
@param[in] icon 图标
@param[in] text 参数被发送到 DButtonBoxButton 构造函数
@param[in] parent 参数被发送到 DButtonBoxButton 构造函数

@fn DButtonBoxButton::DButtonBoxButton(QStyle::StandardPixmap iconType, const QString &text, QWidget *parent)
@brief DButtonBoxButton构造函数.
@param[in] iconType Qt标准图标
@param[in] text 参数被发送到 DButtonBoxButton 构造函数
@param[in] parent 参数被发送到 DButtonBoxButton 构造函数

@fn DButtonBoxButton::DButtonBoxButton(DStyle::StandardPixmap iconType, const QString &text, QWidget *parent)
@brief DButtonBoxButton 构造函数.
@param[in] iconType 标准图标
@param[in] text 参数被发送到 DButtonBoxButton 构造函数
@param[in] parent 参数被发送到 DButtonBoxButton 构造函数

@fn void DButtonBoxButton::setIcon(const QIcon &icon)
@brief 设置按钮图标.
@param[in] icon 图标

@fn void DButtonBoxButton::setIcon(QStyle::StandardPixmap iconType)
@brief 设置按钮图标.
@overload
@param[in] iconType Qt标准图标

@fn void DButtonBoxButton::setIcon(DStyle::StandardPixmap iconType)
@brief 设置按钮图标.
@overload
@param[in] iconType 标准图标

@fn QSize DButtonBoxButton::iconSize() const
@brief 返回图标大小.
@return 图标大小.

@fn QSize DButtonBoxButton::sizeHint() const
@brief 返回按钮的推荐大小.
@return 按钮的推荐大小.
@sa QAbstractButton::sizeHint()

@fn QSize DButtonBoxButton::minimumSizeHint() const
@brief 返回按钮的最小大小策略.
@return 按钮的最小大小策略.
@sa QAbstractButton::minimumSizeHint()
*/

/*!
@~chinese
@file dbuttonbox.h
@ingroup button
@class Dtk::Widget::DButtonBox
@brief DButtonBox 类似于 QButtonGroup 的类.
@details DButtonBox 提供了对按钮的布局方向
@code 示例代码
DButtonBox box;
DButtonBoxButton *btn1 = new DButtonBoxButton("btn1");
DButtonBoxButton *btn2 = new DButtonBoxButton("btn2");
btn1->setIcon(QStyle::StandardPixmap::SP_ArrowUp);
box.setButtonList({btn1, btn2}, true);
@endcode
@image html DButtonBox.png
@sa Dtk::Widget::DButtonBoxButton

@fn DButtonBox::DButtonBox(QWidget *parent)
@brief DButtonBox::DButtonBox 构造函数.
@param[in] parent 参数被发送到 QWidget 构造函数

@fn Qt::Orientation DButtonBox::orientation() const
@brief DButtonBox::orientation 返回布局方向.
@sa Qt::Orientation

@fn void DButtonBox::setOrientation(Qt::Orientation orientation)
@brief DButtonBox::setOrientation 设置布局方向.
@param[in] orientation
@sa Qt::Orientation

@fn void DButtonBox::setButtonList(const QList<DButtonBoxButton *> &list, bool checkable)
@brief DButtonBox::setButtonList 将按钮进添加到组中.
@param[in] list 存储按钮的 QList 列表
@param[in] checkable 按钮是否可选中

@fn QList<QAbstractButton *> DButtonBox::buttonList() const
@brief DButtonBox::buttonList 返回按钮列表.
@return 按钮列表.
@sa QButtonGroup::buttons()

@fn QAbstractButton *DButtonBox::checkedButton() const
@brief DButtonBox::checkedButton.
@return checked 状态的按钮.
@sa QButtonGroup::checkedButton()

@fn QAbstractButton *DButtonBox::button(int id) const
@brief DButtonBox::button
@param[in] id 按钮的ID,与 DButtonBox::setId 设置的参数一致.
@return 返回对应 @param[in] id 的按钮,不存在返回 nullptr .
@sa QButtonGroup::button()

@fn void DButtonBox::setId(QAbstractButton *button, int id)
@brief 设置按钮 id .
@param[in] button 用于设置 @param[in] id 的按钮.
@sa QButtonGroup::setId()

@fn int DButtonBox::id(QAbstractButton *button) const
@brief 返回按钮 id .
@param[in] button 对应的按钮.
@sa QButtonGroup::id()

@fn int DButtonBox::checkedId() const
@brief 返回已选中按钮 id .
@return 返回已选中按钮 id .
@sa QButtonGroup
*/

Loading

0 comments on commit 688f3ed

Please sign in to comment.