How to keep window size proportional to the screen its appearing

  • How does Qt handle screen resolution and size to keep proportion between the Qt window
    and the screen size , for example when I set window size on my development pc

  • Usually, that ratio is not important at all. Qt sizes windows to have a size that will accommodate the widgets in the form with the constraints you gave it. That is irrespective of the screen resolution. If you need your form to have a specific size as a proportion of the screen resolution, you'll have to code that yourself. It is easy enough though, if you use QDesktopWidget to get the screen size...

  • thanks allot for the reply

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.