Reputation: 9
how to make number follow the bar size?
in this qt designer, i create frame which contain bar, and qlabel =500\n\n250\n\n0\n\n-250\n\n-500
Is there a way to create legend in this bar?
or can we make qlabel follow the size of bar?'
Upvotes: -1
Views: 150
Reputation: 473
If I wasn't interested in having accuracy, I would create a structure with layouts like this
QHorizontalLayout
-> QProgressBar
-> QVerticalLayout
-> QLabel (500)
-> QLabel (250)
-> QLabel (0)
-> QLabel (-250)
-> QLabel (-500)
But If accuracy is your priority you should start thinking of making your own custom widget.
p.s. the above is not code, but rather a representation of the widget hierarchy that I suggest. I have just formatted it as a code snippet, just to show the hierarchy :)
Upvotes: 0