This example shows how to check whether the text shown in a widget (in this case a line edit) has been truncated (e.g., because it is wider than the width of the widget).
checkTruncation() function compares the widget’s actual width (from its
width property), with the number of pixels needed to display the entire text (returned by the
requiredWidth() function), and calls Squish’
test.fail() function if the actual width is less than the required width.