View Full Version : QSplashscreen, Qt.WindowStaysOnTopHint And Title Bar

Kel Solaar
18th June 2009, 21:27
Hello :)

I'm using a QSplashscreen for the starting of my Application, the problem I'm encountering is that when I'm using the Window Flag Qt.WindowStaysOnTopHint the QSplashscreen stays on top of every other windows but it also shows a Title bar and a frame ( same on Mac Os X and Windows ).
Anyone have an idea of what to do to avoid this ?



18th June 2009, 22:19
I guess you set the window flags using QWidget::setWindowFlags:

QSplashScreen splash(pixmap);

This goes wrong, because you reset all other flags, especially Qt::SplashScreen.
You should try:

QSplashScreen splash(pixmap);
splash.setWindowFlags(splash.windowFlags() | Qt::WindowStaysOnTopHint);

or even simpler:

QSplashScreen splash(pixmap, Qt::WindowStaysOnTopHint);

because the constructor automatically adds other required flags.

Kel Solaar
18th June 2009, 22:43
Excellent !
I didn't realised that it was resetting the other flags, but now that make sense. Thanks :)