Skip to content

Commit

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

Log: update docs

Issue: linuxdeepin/dtk#94
  • Loading branch information
LEpoii authored and Whale107 committed Aug 28, 2024
1 parent 12d4542 commit 229ae94
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
Binary file added docs/images/DWarningButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions docs/widgets/dwarningbutton.zh_CN.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@
@~chinese
@file dwarningbutton.h
@ingroup button
@class
@brief
@details
@class Dtk::Widget::DWarningButton
@brief 警告按钮控件
@details
继承于 DPushButton 控件, 主要替换了文字和背景的颜色.
@note 通常在执行一些比较危险的动作时候, 给出的一个提醒标识, 但是并不强制阻止; 如: 某些小程序需要较高的权限才能够运行; 删除文件不可恢复等

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

@sa QPushButton

@fn DWarningButton::DWarningButton(QWidget *parent): DPushButton(parent)
@brief DWarningButton 的构造函数
@param[in] parent 父控件

@fn void DWarningButton::initStyleOption(QStyleOptionButton *option) const
@brief 初始化控件风格属性
@param[in] option 用于初始化本控件的具体基础风格属性

*/

21 changes: 12 additions & 9 deletions src/widgets/dwarningbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@
DWIDGET_BEGIN_NAMESPACE

/*!
\class Dtk::Widget::DWarningButton
@~english
@class Dtk::Widget::DWarningButton
\inmodule dtkwidget
\brief 警告按钮控件, 继承于 DPushButton 控件, 主要替换了文字和背景的颜色.
\note 通常在执行一些比较危险的动作时候, 给出的一个提醒标识, 但是并不强制阻止; 如: 某些小程序需要较高的权限才能够运行; 删除文件不可恢复等
\sa QPushButton
@brief warning button widget
@details inherits from DPushButton widget, mainly replacing the color of text and background.
@note Usually gives a warning sign when executing some dangerous commands but not forbid it; For example: some programs require higher permission to run; files connot be restored after delete
@sa QPushButton
*/

/*!
\brief 构造函数
\a parent 本控件的父对象
@~english
@brief constructor
@param[in] parent is the parent object of this widget
*/
DWarningButton::DWarningButton(QWidget *parent): DPushButton(parent)
{
}

/*!
\brief 初始化风格属性
\a option 用来初始化本控件的基础的风格属性
@~english
@brief initialize the style option
@param[in] option is the style option used to initialize this widget
*/
void DWarningButton::initStyleOption(QStyleOptionButton *option) const
{
Expand Down

0 comments on commit 229ae94

Please sign in to comment.