2

i have a window made of a bunch of horizontal and vertical layouts, each one containig a grid layout tabling out labels.

the whole thing shows the values of a cpu's registers and when the program is executing the lables change values according to the virtual cpu, so i did set the labels' font to a monospace font to avoid constant resizing.

i recently noticed that the window border flickers when the program runs, going step by step i found that it happens each time a "2" is the last (rightmost) digit of a label. when the 2 is written on the right end of the string the whole window stretches a bit, when the 2 gets overwritten by another character the window shrinks back to the original size.

if the 2 is in any other position in a string nothing bad happnes.

i'm running a debian wheezy machine with qt 4.8.2, i've noticed that if i run the application under ubuntu (in a virtual machine) the "2" character is harmless but the "A" one does the same thing..

am i the only one facing this issue?

i already tried to set a fixed size for the labels (based on their size when initialized with all zeros) but it seems that i cant get a meaningful size from the widget and i end up with huge labels that destroy the entire layout

mellotanica
  • 174
  • 5
  • 12
  • Qt layouts are made to react and adapt to the resize events (of the window, or of the children). And `QLabel` will adapt its preferred-size based on its content, so if you keep changing the content everybody is trying to resize all the time. Your issue might be a bug while painting the font, but I think your design is at risk anyway if you want to get a fixed grid of values. – ymoreau Feb 23 '18 at 13:49

0 Answers0