PDA

View Full Version : How to Keep Splash Screen and App on Same Display



ajb_advance
3rd March 2009, 12:20
Hi,

I'm running on windows with multiple monitors and my splash screen always appears on the main monitor although the application will start on either the main or secondary monitor (it remembers the screen position it was last run). I'd like the splash to appear on the same monitor as the application. Is there a way to do this?

Thanks for your help.

^NyAw^
3rd March 2009, 17:18
Hi,

I supose that you start the application on the second monitor without using Qt?
What you have to do is to move the application or splash screen(note that are widgets) to the monitor you want using desktop geometry:



//Get desktop geometry available
QRect qAvGeom = app.desktop()->availableGeometry(0);

int iScreen = 2; //Move to second monitor
mainWindow.move((iScreen-1)*(qAvGeom .width()+1),mainWindow.y());


This works if the desktop is configured as "expand" or similar.

ajb_advance
4th March 2009, 11:49
Thanks! I used code similar to your example to move the splash screen onto the same display as the main window.