diff --git a/docs/images/dsuggestbutton.png b/docs/images/dsuggestbutton.png new file mode 100644 index 000000000..3818757ae Binary files /dev/null and b/docs/images/dsuggestbutton.png differ diff --git a/docs/widgets/dsuggestbutton.zh_CN.dox b/docs/widgets/dsuggestbutton.zh_CN.dox index f942a98fd..b0c3c07d5 100644 --- a/docs/widgets/dsuggestbutton.zh_CN.dox +++ b/docs/widgets/dsuggestbutton.zh_CN.dox @@ -2,11 +2,51 @@ @~chinese @file dsuggestbutton.h @ingroup button -@class -@brief + +@class Dtk::Widget::DSuggestButton +@brief 这个控件提供了DTK中默认的建议按钮样式.点击按钮后会显示相应的建议信息 @details +### 使用示例 +#### mian.cpp +```cpp +#include +#include +#include +#include + +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 */ + + diff --git a/src/widgets/dsuggestbutton.cpp b/src/widgets/dsuggestbutton.cpp index ee6f5cea3..997d39b34 100644 --- a/src/widgets/dsuggestbutton.cpp +++ b/src/widgets/dsuggestbutton.cpp @@ -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) @@ -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)