Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Saving app's window position - on multiple monitors and scaled Windows 10
Forum Updated to NodeBB v4.3 + New Features

Saving app's window position - on multiple monitors and scaled Windows 10

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 905 Views 1 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.
  • D Offline
    D Offline
    dennisf
    wrote on last edited by
    #1

    Hi,

    I am using Qt 5.14.0. If I have two monitors next to each other running Windows 10, both at 200% scaling, I get strange behavior with my application.

    A feature of my app is that it remembers the x and y coordinates of the application. This way, the next time the user opens it, it will appear at the same place. This works fine if I open the app on my main monitor, close it, and then reopen. It will appear at the exact same coordinates. However, if I instead move it to my second (non-main) monitor, close it there, and then reopen, the app will not open exactly where I closed it. Instead, the coordinates have been changed a little bit. In some cases this is enough for the application to open outside of the monitor, making it "invisible".

    A few examples:

    1. If main monitor is 100% and second is 175%
      Opening and closing on main monitor keeps the same x and y coordinates. However, opening and closing on second monitor changes x and y coordinates.
    1. If both main and second monitor are 175%
      Same result as above

    2. If both main and second monitor are 100%
      Works as intended. Opening and closing on either monitor keeps the same x and y coordinates.

    Has anyone encountered similar issues?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcleary
      wrote on last edited by
      #2

      How are you restoring the values? Is that a Widgets or QML application?

      D 1 Reply Last reply
      0
      • D Offline
        D Offline
        dennisf
        wrote on last edited by
        #3

        I am using code very similar to this to restore the values.
        It is a QML application.

        1 Reply Last reply
        0
        • M mcleary

          How are you restoring the values? Is that a Widgets or QML application?

          D Offline
          D Offline
          dennisf
          wrote on last edited by
          #4

          @mcleary any ideas why I might run into this problem?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcleary
            wrote on last edited by
            #5

            Sorry for the late reply. I was hoping for you to say widgets, but I never tried this with QML so far. Unfortunately I don't have multiple monitor to test it myself at moment.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Kamil Kirstein
              wrote on last edited by
              #6

              Hi, I have the same problem but on a Widget App :) so maybe one of you can still help?

              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