Yes, one instance. I can confirm it is so because I only had one qDebug() call in the reimplementation of resizeEvent() for that instance. Removing it from there and testing the other classes, the same thing happens.
I didn't mean to insult Qt, I think it's the best tool out there. I hope you are right, I've been trying to find for ages how to do this. What I meant is that you can't specify font size based on the parent widget's size, i.e. you can't set a font size unit as %. Point, ems and pixels will all take the same space regardless of the parent's size.
At 800x600 I've a really tiny space and I need the font size to be smaller so it fits, on the other hand if the program is at a very high resolution I need the font size to be much bigger so the space doesn't look empty. I've made an ugly solution using QFontMetrics to find out what's the biggest size that fits in a QLabel, I've to call this solution from resizeEvent(). The ideal thing would be that Qt's layout or stylesheet system handled it automatically but it doesn't. I know the problem is not in this ugly solution I made because as I said before, commenting out the code, the event is still triggered 3 times when you call .showMaximized() and 2 times for .show().
EDIT: I forgot to add why editing the label's size manually is necessary in the resizeEvent() and I can't rely on the layout system. The reason is that when resizing to a smaller size for example, when it comes to calculating the new sizes the layout system will use the old big font size to calculate what the label's new size should be, so the label's size won't be proportional to what it should be because its font size hasn't been changed yet.
I've tried every possible combination of sizePolicy, setStretchFactors, etc... but the proportions go out of the window unless I use fixed sizes, I've also installed event filters for each label to see if from there I could make it work. At the end the only solution I've found is using fixed sizes and setting them in the resizeEvent(), however, I get that wobbly effect from the OP.
Thanks for your reply.
Bookmarks