Bad GUI size. possible misuse of layouts in Qt Designer

I developed a GUI with Qt Designer and I have to distribute it on many computers with different resolutions. My problem is that the graphical interface does not scale properly on different screens: the main window may be truncated, some tables also have fonts that are not the same size. I found many thoughts on the forums about using layouts to resize correctly, but I have to abuse them since I already use layouts without solving the problem. I've tried a lot, but I don't see the trick. Can you tell me what I'm doing wrong?

For example, this is the correct view of one page: enter image description here

This is a damaged view of the same page, the same computer with a different resolution: enter image description here the difference is acceptable, as it is simply truncating the label of more complex models. But this is a view of windows 7: enter image description here

Here is my Qt Designer interface (feel free to request more information, as I don't know what is appropriate): enter image description here

The ui file is here: https://github.com/steph2016/profiles/blob/master/cprofiles.ui .


update January 12th.

I simply emphasize that:

  • If some encoding is required, I prefer python (3.5+), qt5 and pyqtgraph.
  • since I don’t know if it is possible to solve the problem with coding, and since I do not get much attention, I add pyqt5 and qt5 to the tags. sorry if this turns out to be not an item.
+5
source share
1 answer

I checked your cprofiles.ui. You seem to be using a lot of fixed sizes that explain the look in the windows. I also see this, so this is not a mistake, but a problem of conceptual design.

What can you do:

check the fixed_alpha0_2 checkbox in the widget and insert the horizontal and vertical spacers into it. Think about what maximum word length will be present next to “fixed” and set it to max.size. The spacer will push it to the left / top side so that it is supported in accordance with the box of double boxes valalpha0_2. You have already done this on the tab "general configuration", which you call "tab_5".

Hint: name it as "t5_gen.config" .. makes more sense to others who may need to continue in the future with your gui.

Alternative: use the switches for a “free” or “fixed” model. Paste them into the horizontal layout inside the optional widget in the gridlayout that you are currently using.

Predicting your water content will be fun. You might want to add the parameter Ca2 +, -)

See the github post for the downloaded ui file, which shows in Qt, which I tried to explain here.

+1
source

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


All Articles