QWidget's method move calculates bad position
-
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:- Is there ellegant way to globally set frame size for move method or i should make my own move method?
- Should i report it as bug or it repaired in Qt 5.8.0?
Thank you for your time.
-
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).aspxAnd hence should have the correct value.
-
@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
-
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.
-
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.
-
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"