Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update docs for dwatermarkhelper #591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/dwatermarkhelper_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/widgets/dwatermarkhelper.zh_CN.dox
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,51 @@
@param[in] parent
@sa DWaterMaskHelper::instance

@details
### 实例代码
#### main.cpp

```cpp
#include <DApplication>
#include <DWaterMarkHelper>
#include <QMainWindow>

using namespace Dtk::Widget;


int main(int argc,char* argv[])
{
QApplication a(argc,argv);

QMainWindow w;
w.show();

auto ins = DWaterMarkHelper::instance();

WaterMarkData data = ins->data();
data.setText("dtk example");
data.setType(WaterMarkData::WaterMarkType::Text);
data.setLayout(WaterMarkData::WaterMarkLayout::Tiled) ;
data.setRotation(30);
data.setScaleFactor(0.5);
data.setColor(Qt::red);
QFont font;
font.setPointSize(30);
data.setFont(font);
data.setSpacing(65);
data.setLineSpacing(-1);
data.setOpacity(0.3);
data.setGrayScale(true);

ins->setData(data);

ins->registerWidget(&w);
return a.exec();
}
```
### 实例图片
@image html dwatermarkhelper_example.png

@fn DWaterMarkHelper::instance
@brief DWaterMarkHelper 的单例对象,使用 Q_GLOBAL_STATIC 定义,在第一次调用时实例化。

Expand Down
Loading