Solved 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.
- 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.
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
And hence should have the correct value.
SetGeometry does not have offset but it does not calculate with window frame at all.
Did you look into what
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.
Do you have link for bug report ?
I tried ( on win 10)
int frame = GetSystemMetrics(SM_CXBORDER);
and it does report 1
There is not reported this specific bug but other very similar which roots in window frame handling by Qt.
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"