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. QWidget's method move calculates bad position
QtWS25 Last Chance

QWidget's method move calculates bad position

Scheduled Pinned Locked Moved Solved General and Desktop
qwidgetmove problemwindows10qt 5.7.0
8 Posts 2 Posters 4.5k Views
  • 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.
  • G Offline
    G Offline
    Galli33
    wrote on last edited by Galli33
    #1

    Hello, i am experiencing bad behavior when i use move method on qwidget used as window. If i move(0,0) i expect to move window to left top corner with respect given to frame of the window, but this window is moved like move(7,0). I think it is because my OS is Windows 10 and this method calculates with Windows 8 frame size. I am using Qt 5.7.0.
    Question:

    1. Is there ellegant way to globally set frame size for move method or i should make my own move method?
    2. Should i report it as bug or it repaired in Qt 5.8.0?

    Thank you for your time.

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

      Hi
      Does setGeometry also have this offset issue?

      You could go look in the bug base for bugs that sounds like this.

      I would expect Qt to use the
      https://msdn.microsoft.com/en-us/library/ms724385(v=vs.85).aspx

      And hence should have the correct value.

      1 Reply Last reply
      1
      • G Offline
        G Offline
        Galli33
        wrote on last edited by
        #3

        SetGeometry does not have offset but it does not calculate with window frame at all.

        mrjjM 1 Reply Last reply
        0
        • G Galli33

          SetGeometry does not have offset but it does not calculate with window frame at all.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @Galli33
          ok.
          Did you look into what
          http://doc.qt.io/qt-5/qwidget.html#frameGeometry-prop
          reports?

          http://doc.qt.io/qt-5/application-windows.html#window-geometry

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Galli33
            wrote on last edited by Galli33
            #5

            frameGeometry contains size of the widget plus window frame(left 8, top 31, right 8, bottom 8) but it is not the real geometry of the window. Real frame size for Windows 10 is like(?) left 1, top 31, right 1, bottom 1. I guess Qt just gets wrong frame size from its inner settings and not getting real values from OS.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              Galli33
              wrote on last edited by Galli33
              #6

              Well i just looked in bug reports and it looks like window frame is kind of issue which is not properly taken care of. If it is not repaired in Qt 5.8.0 (i guess not), i will need to make some workaround properly handling window frame.

              After some time, in case someone would want reply a good solution, i will mark this post as solved.

              mrjjM 1 Reply Last reply
              1
              • G Galli33

                Well i just looked in bug reports and it looks like window frame is kind of issue which is not properly taken care of. If it is not repaired in Qt 5.8.0 (i guess not), i will need to make some workaround properly handling window frame.

                After some time, in case someone would want reply a good solution, i will mark this post as solved.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Galli33
                Hi
                Do you have link for bug report ?

                I tried ( on win 10)
                int frame = GetSystemMetrics(SM_CXBORDER);
                and it does report 1

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  Galli33
                  wrote on last edited by
                  #8

                  There is not reported this specific bug but other very similar which roots in window frame handling by Qt.
                  For example:
                  https://bugreports.qt.io/browse/QTBUG-53368?jql=text ~ "frame size windows"
                  https://bugreports.qt.io/browse/QTBUG-31735?jql=text ~ "frame size windows"
                  https://bugreports.qt.io/browse/QTBUG-14613?jql=text ~ "frame size windows"

                  1 Reply Last reply
                  1

                  • Login

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