Python Forum

Full Version: display content from left to right in QComboBox or QLineEdit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I have several QComboBoxes and QLineEdits on my UI, which can show different content depending on user selections.
However, when the user changes settings, the content of the QComboBox or QLineEdit gets displayed starting at the back of the content.

For instance:
I have the number 28.599999999999994 in a QComboBox. The QComboBox is too short to show the complete number.
But, instead of displaying 28.599 it displays 999994. How can I change this such that it start at the front of the string, rather then at the back?

Is there a solution for this?

Thanks!
You may be able to use the resize function to change the length of your widget based on the length of user input.
you can give the Combobox a fixed size.

your_combobox.setFixedWidth(xxx)