obsidian/笔记文件/2.笔记/解决网页在qt半透明情况下,无法正常渲染的问题.md
2025-03-26 00:02:56 +08:00

23 lines
539 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#qt
先创建一个,什么都没有的,半透明空白背景
![[Pasted image 20240706182916.png]]
可以看到,它的父类,是设置了半透明的
![[Pasted image 20240706182939.png]]
然后渲染用来打开网页的dialog是作为子物体new出来再show和raise即可
![[Pasted image 20240706183133.png]]
``` cpp
dialog = new PayDialog;
dialog->setParent(this, dialog->windowFlags());
dialog->show();
qInfo()<<"打开网页:"<<m_url;
dialog->OpenPayUrl(m_url);
dialog->raise();
```