Results 1 to 4 of 4

Thread: Application Window Lost When Moving from 2 Screens to 1

  1. #1
    Join Date
    Oct 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Question Application Window Lost When Moving from 2 Screens to 1

    Hi,

    I have an application with a single window.

    When I run the application it works fine when I just use my laptop screen or when I have a second screen plugged in.

    The problem comes when I try to switch between them, for example when I open the application on the second screen, then disconnect the second screen I am unable to get the application to show in my laptop screen.

    I believe that the application is still open at the location on the second screen which no longer exists.

    I wondered how I can make my application update/check its location so it does not get lost when the second screen is removed?
    I have had a look into QWindow & QDesktopWidget Class but can't seem to find a simple elegant solution to my problem.

    Windows Application
    Qt 5.4
    Last edited by JimGib; 14th October 2015 at 14:24.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Application Window Lost When Moving from 2 Screens to 1


  3. #3
    Join Date
    Oct 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Application Window Lost When Moving from 2 Screens to 1

    Thanks for that link, I had previously seen it but was unsure on how best to implement it to stop my application form getting lost on a second screen.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Application Window Lost When Moving from 2 Screens to 1

    When a screen gets removed, you get the screen of your window and compare.
    If that is the screen that just went away, you use setScreen() with e.g. the primary screen or the first screen in screens()

    Cheers,
    _

Similar Threads

  1. How to develop an Application with multiple screens
    By screwgoth in forum Qt Programming
    Replies: 1
    Last Post: 19th August 2012, 01:11
  2. QML screens managed by cpp application
    By moti.lahiani in forum Qt Quick
    Replies: 0
    Last Post: 18th November 2011, 10:00
  3. Application Lost Focus / Inactive / In Background
    By javed_alam786 in forum Qt Programming
    Replies: 3
    Last Post: 10th May 2011, 11:12
  4. Application Lost Focus / Inactive / In Background
    By javed_alam786 in forum Newbie
    Replies: 2
    Last Post: 10th May 2011, 11:08
  5. How detective lost focus application ?
    By Torsten in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 15:19

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.