Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Keep size of window on moving to other monitor with high DPI

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BrMisha
    wrote on last edited by
    #1

    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?
    Thanks))

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      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.

      If you meet the AI on the road, kill it.

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

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

        https://doc.qt.io/qt-5/highdpi.html

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved