Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bad resizing GUI. possible misuse of layouts in Qt Designer

I designed a GUI with Qt Designer and need to distribute it on many computer with different resolutions. My problem is that the GUI does not scale properly on the different screens: the main window may be truncated, some tables also and the fonts do not have the same size. I found many considerations on forums about using layouts to resize things properly, but I must misuse them since I already use layouts without solving the issue. I tried many things but I don’t see the trick. Can you tell me what I am doing wrong ?

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

This is a corrupted view of the same page, same computer with a different resolution:enter image description here the difference is acceptable since it is just a truncation of the 'more complex models' label. But this is the view on a windows 7:enter image description here

Here is a view of my Qt Designer interface (don’t hesitate to ask for some more info since I don’t know what’s relevant): enter image description here

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


update january 12.

I just underline that:

  • if some coding is required, I prefer python (3.5+), qt5 and pyqtgraph.
  • since I don't know if the problem can be solved via coding and since I don't receive much attention, I add pyqt5 and qt5 in the tags. sorry if it turns out this is not the subject.
like image 496
Stéphane Avatar asked Nov 08 '22 12:11

Stéphane


1 Answers

I've checked your cprofiles.ui. You seem to use a lot of fixed sizes which explain the view in windows. I see it too so its not an error but more a conceptional design issue.

What you can do:

box the fixed_alpha0_2 in a widget and throw a horizontal and vertical spacer inside with it. Think about what maximum word length will be in there beside "fixed" and set that as max.size value. The spacer will push it to the left/upper side such that it keeps aligned with the doublespinner box valalpha0_2. You already did similar at the "general config" tab you call "tab_5".

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

Alternative: use radio buttons for "free" or "fixed" model. Box them in a horizonal layout inside an additional widget within the gridlayout you're now using.

Your watersalinity prog will be fun I reckon. You may want to add Ca2+ parameter somewhere ;-)

See your github post for uploaded ui-file that shows in Qt what I tried to explain here.

like image 63
ZF007 Avatar answered Dec 22 '22 12:12

ZF007