是否可以设置qt小部件的不透明度? [英] Is it possible to set the opacity of qt widgets?

查看:240
本文介绍了是否可以设置qt小部件的不透明度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一个函数 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论坛: 1)如何做不透明度Qt小部件的动画?

A very similar question is posted in one Qt forum: 1) How to do opacity animation for Qt widgets?

这篇关于是否可以设置qt小部件的不透明度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆