问题描述
我知道有一个函数 QWidget :: setWindowOpacity(qreal level)
但是在文档中写的这只适用于窗口。
I know that there is a function QWidget::setWindowOpacity(qreal level)
but as written in the documentation this does only work for windows.
有一种方法可以让布局中的窗口部件不透明吗?
Is there a way to make widgets that are lying inside layouts opaque too?
我想做的是一个动画小部件正在消失。我曾经使用一个首选项对话框,并且它工作。
What I'm trying to do is an animation where widgets are fading in. I once did that with a preferences-dialog and there it worked.
因此,你认为有一种方法或解决方法来实现不透明度对于布局内的小部件?
So do you think there is a way or a work-around to achieve opacity for widgets inside layouts? How would you do that?
提前感谢!
推荐答案
一个非常类似的问题发布在一个Qt论坛:
A very similar question is posted in one Qt forum: 1) How to do opacity animation for Qt widgets?
这篇关于是否可以设置qt小部件的不透明度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!