Skip to content

Commit

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

Log: update docs

Issue: linuxdeepin/dtk#94
  • Loading branch information
homehomehu authored and Whale107 committed Aug 28, 2024
1 parent cc130c7 commit bcca267
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
Binary file added docs/images/dsuggestbutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 43 additions & 3 deletions docs/widgets/dsuggestbutton.zh_CN.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,51 @@
@~chinese
@file dsuggestbutton.h
@ingroup button
@class
@brief

@class Dtk::Widget::DSuggestButton
@brief 这个控件提供了DTK中默认的建议按钮样式.点击按钮后会显示相应的建议信息
@details
### 使用示例
#### mian.cpp
```cpp
#include <DApplication>
#include <DMainWindow>
#include <QLayout>
#include <DSuggestButton>

DWIDGET_USE_NAMESPACE

int main(int argc, char *argv[])
{
DApplication a(argc, argv);
DMainWindow w;
w.setMinimumSize(QSize(600, 200));

QWidget *cw = new QWidget(&w);
QVBoxLayout *layout = new QVBoxLayout(cw);

TODO: 添加类简介、示例代码、示例截图和函数使用说明等
DSuggestButton *suggestButton = new DSuggestButton("suggest_button", cw);
layout->addWidget(suggestButton);
layout->setAlignment(Qt::AlignCenter);

w.setCentralWidget(cw);
w.show();

return a.exec();
}
```
### demo运行示例
@image html dsuggestbutton.png
该示例展示了一个展示了一个名字为“suggest_button”的建议按钮.

@fn DSuggestButton::DSuggestButton(QWidget *parent)
@brief DSuggestButton的构造函数
@param[in] parent

@fn DSuggestButton::DSuggestButton(const QString &text, QWidget *parent)
@brief DSuggestButton的重载构造函数,接收默认显示的文字
@param[in] text 默认显示的文字
@param[in] parent
*/


20 changes: 10 additions & 10 deletions src/widgets/dsuggestbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
DWIDGET_BEGIN_NAMESPACE

/*!
\class Dtk::Widget::DSuggestButton
\inmodule dtkwidget
\brief 这个控件提供了DTK中默认的按钮样式.
@~english
@class Dtk::Widget::DSuggestButton
@brief This widget provides the default suggest button style in DTK.
*/

/*!
\brief DSuggestButton的构造函数
\a parent
@~english
@brief Constructor of DSuggestButton
@param[in] parent
*/
DSuggestButton::DSuggestButton(QWidget *parent)
: QPushButton(parent)
Expand All @@ -29,10 +29,10 @@ DSuggestButton::DSuggestButton(QWidget *parent)
}

/*!
\brief DSuggestButton的重载构造函数,接收默认显示的文字
\a text 默认显示的文字
\a parent
@~english
@brief Overloaded constructor of DSuggestButton that accepts the default displayed text.
@param[in] text The default displayed text
@param[in] parent
*/
DSuggestButton::DSuggestButton(const QString &text, QWidget *parent)
: QPushButton(text, parent)
Expand Down

0 comments on commit bcca267

Please sign in to comment.