简体   繁体   English

QMainWindow背景:透明不适用于Qt4.8

[英]QMainWindow background : transparent not working with Qt4.8

I was setting QMainwindow background to transparent on CSS file.This was not giving any effect on my mainwindow. 我在CSS文件上将QMainwindow背景设置为透明,这对我的主窗口没有任何影响。 If i set background to red or any other color it is getting reflected on my mainwindow. 如果我将背景设置为红色或任何其他颜色,它将在我的主窗口中反映出来。

My mainwindow is transparent while i was working with the Qt4.7.1 version. 当我使用Qt4.7.1版本时,我的主窗口是透明的。 after updating the qt version to 4.8 with the transparent background property i was getting black background. 用透明背景属性将qt版本更新为4.8后,我得到了黑色背景。 I was cross compiled qt4.8 to Mips and i was working on MIPS platform. 我被交叉编译到Mips的qt4.8,并且正在MIPS平台上工作。

Is there any idea on this? 有什么想法吗?

Thanks. 谢谢。

There are several questions about how to create a transparent window: 关于如何创建透明窗口,存在几个问题:
How to make a transparent window with Qt Quick? 如何使用Qt Quick制作透明窗口?
How to get an simple transparent window? 如何获得一个简单的透明窗口?
Transparent Windows. 透明的Windows。

You can also try to create a new simple empty transparent MainWindow and see if it works correctly. 您也可以尝试创建一个新的简单的空透明MainWindow,然后查看其是否正常运行。 If yes than you should review your project. 如果是,则应检查项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM