How can I get QLabel to resize even if it means truncating its containing text? I have a QLabel stretching the entire horizontal space of a widget. When setting up its text, I am sure that it is truncated correctly, i.e. Gets its FontMetrics and Width and uses metrics.elidedText ().
But when the user resizes the widget, the shortcut does not allow it to shrink further, as it truncates its text.
Any ideas how to solve this? The simplest solution, which, it seems to me, would be to somehow tell QLabel to always compress, and then catch the resize event and format the text correctly - I just don’t know how to make the first part (policies of different sizes do not help)
qt qt4 pyqt pyqt4
Voo
source share