labscript_utils.qtwidgets.elide_label.elide_label

labscript_utils.qtwidgets.elide_label.elide_label(label, layout, elide_mode)[source]

Take an existing label that is in a layout, and wrap it in our widgets that elide the text, and insert it back into the layout. This is a hack that allows us to elide a QLabel with a single line of (possibly rich) text, a task that seems pretty much impossible to do in any kosher way.

This function is for modifying an existing label already in a layout, but if you are programatically creating a label, then you can wrap it in ElidedLabelContainer(label) before inserting it into a layout or other container widget, which is more flexible than this function which only works if the label is in a QBoxLayout