Results 1 to 2 of 2

Thread: Detect if window is bigger than screen

  1. #1
    Join Date
    May 2012
    Posts
    99
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Detect if window is bigger than screen

    Hi all,

    Sometimes my window increases the size and it is bigger than screen. How can I restrict the window size to not overflow the width of the screen?

    Regards.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,328
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Detect if window is bigger than screen

    In your window constructor, use the QScreen class to determine the screen geometry, and use that to set the window's maximum size. If you are going to do that, you should either derive your window class from QAbstractScrollArea, implement your own scrollbar support, or somehow change the way the window contents are painted to ensure it all stays visible to the user.

Similar Threads

  1. Touch screen need larger (bigger) widgets
    By creatron in forum Qt Programming
    Replies: 0
    Last Post: 31st May 2014, 12:20
  2. Replies: 0
    Last Post: 26th June 2010, 00:40
  3. Detect screen rotation or resize
    By leoalvesmachado in forum Newbie
    Replies: 2
    Last Post: 9th April 2010, 01:20
  4. How to detect multi screen in QT?
    By Kevin Hoang in forum Qt Programming
    Replies: 9
    Last Post: 26th March 2010, 23:02
  5. detect which layer of the screen an application is on
    By solartic in forum Qt Programming
    Replies: 2
    Last Post: 22nd July 2009, 17:05

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
  •  
Qt is a trademark of The Qt Company.