PyQt5 - How to get title bar height?
-
I'm trying to store the geometry of the window when you close it. But on different operating systems or different settings the title bar height it's different, so it will slowly go down if you close and open the window many times.
So my question is if there is a way to get title bar height?I tried this answer https://forum.qt.io/topic/99528/window-titlebar-height-example/3 but it didn't work (on Ubuntu).
-
I'm trying to store the geometry of the window when you close it. But on different operating systems or different settings the title bar height it's different, so it will slowly go down if you close and open the window many times.
So my question is if there is a way to get title bar height?I tried this answer https://forum.qt.io/topic/99528/window-titlebar-height-example/3 but it didn't work (on Ubuntu).
@Patitotective said in PyQt5 - How to get title bar height?:
But on different operating systems or different settings the title bar height it's different
But it should be the same on same system?
Also you shouldn't actually care about the title bar. Only store and restore the geometry of the main window like shown here: https://doc.qt.io/qt-5/restoring-geometry.html -
@Patitotective said in PyQt5 - How to get title bar height?:
But on different operating systems or different settings the title bar height it's different
But it should be the same on same system?
Also you shouldn't actually care about the title bar. Only store and restore the geometry of the main window like shown here: https://doc.qt.io/qt-5/restoring-geometry.html@jsulm Seems to have the same problem as restoring the window geometry for my own.
-
@jsulm Seems to have the same problem as restoring the window geometry for my own.
@Patitotective said in PyQt5 - How to get title bar height?:
Seems to have the same problem as restoring the window geometry for my own
Not sure what you mean?
Do you mean the approach I posted? If so can you show your code? -
@Patitotective said in PyQt5 - How to get title bar height?:
Seems to have the same problem as restoring the window geometry for my own
Not sure what you mean?
Do you mean the approach I posted? If so can you show your code?@jsulm When I was writing the example the bug disappeared, so for now it's solved.