QMainWindow set frameSize

How do you set frameSize QMainWindow?

To explain what I'm trying to do, the requirement that I need to fulfill is that the height of the main window of my program will be equal to the height of the screen minus the taskbar; but the width should be significantly less than the screen width on a modern widescreen monitor, so I can’t just enlarge the window.

I can find the screen height minus the taskbar with no problem with QApplication::desktop()->availableGeometry(). However, a call resizein a window with this value does not work; as far as I can tell, resizeit makes the interior occupied by a certain space, in contrast to the external fit being in a certain space. The documentation seems to suggest that the corresponding property of the window frameSize, but does not provide a direct way to set it. I can probably do a trial and feedback between resizeand frameSize, but is there a more elegant / idiomatic way to do this?

+3
source share
1 answer

. . . frameGeometry() geometry() ( ), resize() ( setFixedSize(), ),

, , - . , !

+6

Source: https://habr.com/ru/post/1789997/


All Articles