Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkwidget
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#591
  • Loading branch information
deepin-ci-robot committed Aug 29, 2024
1 parent f18b453 commit 126f7eb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion src/widgets/dtitlebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ bool DTitlebar::eventFilter(QObject *obj, QEvent *event)
switch (event->type()) {
case QEvent::ShowToParent:
d->handleParentWindowIdChange();
d->updateButtonsState(d->targetWindow()->windowFlags());
d->handleParentWindowStateChange();
break;
case QEvent::Resize:
if (d->autoHideOnFullscreen) {
Expand Down

0 comments on commit 126f7eb

Please sign in to comment.