Transparent Splashscreen Picture Qt

纵饮孤独 提交于 2019-12-11 12:49:33

问题


I have created a splash-screen.png for my application. Unfortunately all the parts that should be transparent are drawn as a rectangle. To be able to understand better what I mean a small example-description: (I havnt got enough reputation to put a picture into the forum)

Lets say I have a png as splash-screen which shows a sphere. The sphere should stand for itself, but Qt draws a rectangle around it, which destroys all the atmosphere.

Would be very grateful if you know if there is another possibility to maintain the transparency around the object.

Thanks


回答1:


This seems to be a known bug. As suggested in the bug report a workaround is to use a QLabel instead of a QSplashScreen.

Also check this forum post. A solution is proposed by subclassing QSplashScreen.




回答2:


With the following flags, my png has a transparent frame:

splash.setWindowFlags( Qt::WindowStaysOnTopHint | Qt::SplashScreen | Qt::FramelessWindowHint );



来源:https://stackoverflow.com/questions/9569451/transparent-splashscreen-picture-qt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!