title: How can I limit text box width of QLineEdit to display at most four characters?
body: <p>I am working with a GUI based on PySide. I made a (one line) text box with <code>QLineEdit</code> and the input is just four characters long, a restriction I already successfully applied.</p>
  
  <p>The problem is I have a wider than needed text box (i.e. there is a lot of unused space after the text). How can I shorten the length of the text box?</p>
  
  <p>I know this is something that is easily fixed by designing the text box with Designer; however, this particular text box is not created in Designer.</p>