Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Prevent QLabel from expanding when text length increases
Qt_User72653 last edited by
I have a horizontal layout with 3 labels where the labels on the left and right have expanding size policies and the label in the center has a fixed size. I want the middle label to always be centered, but when the text of the left or right expands it's pushing the other labels to the right or left.
Is it possible to have a QLabel truncate text without having to give it a fixed size?
Well its fairly easy to make.
you can just promote your widgets to ElideLabel
make it easy to switch them out.