I’m trying to make a ratio between 2 numbers (likes & dislikes).
The result is a number in percent. Then I want to make the width from the label equal that percent.
So If there are 100 likes and 1 dislike. I want to make the dislike label 1 percent the width of the like bar. So basically like the youtube rating system.
Example image:

But I don’t see any function to set the width of the label.
So how do I need to do this, anyone have suggestions?
QLabel::setFixedWidth(int). Though to make it more flexible (don’t have to worry about layouts changing things), I would subclassQWidget, add slots for the two numbers, and reimplementpaintEvent(..)to draw the two sections.