Qt World Summit: Register Today!

Keep size of window on moving to other monitor with high DPI

  • Hi!
    I have 2 monitors, second one has high DPI. When i move window (QDialog) to second monitor, window changes size (with and high in pixels).
    How can i disable that?

  • no, it shouldn't change its pixel dimensions, but as you said, the other monitor has a different pixel density so of course it's going to appear a different size. The only way I know of to handle that is to use an API to get the DPI of the source and destination monitors and use that as a scaling factor so that when its geometry/location changes to the other monitor the resize() method gets called to set it accordingly.

  • Lifetime Qt Champion

    You can also try change to System-DPI Aware and see if you like that better.


    That said, with no DPI scaling - text and icons might become too small.

Log in to reply