Results 1 to 3 of 3

Thread: How to Keep Splash Screen and App on Same Display

  1. #1
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default How to Keep Splash Screen and App on Same Display

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to Keep Splash Screen and App on Same Display

    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:

    Qt Code:
    1. //Get desktop geometry available
    2. QRect qAvGeom = app.desktop()->availableGeometry(0);
    3.  
    4. int iScreen = 2; //Move to second monitor
    5. mainWindow.move((iScreen-1)*(qAvGeom .width()+1),mainWindow.y());
    To copy to clipboard, switch view to plain text mode 

    This works if the desktop is configured as "expand" or similar.
    Òscar Llarch i Galán

  3. The following user says thank you to ^NyAw^ for this useful post:

    ajb_advance (4th March 2009)

  4. #3
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to Keep Splash Screen and App on Same Display

    Thanks! I used code similar to your example to move the splash screen onto the same display as the main window.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.