问题
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