Closed xzfantom closed 3 years ago
This is usually pretty simple to fix: change BtLineEdit
to QLineEdit
for the relevant entry field.
BtLineEdit
is only needed for numeric fields, where it adds the logic to convert units (eg °F to °C, or grams to kilograms, etc). Its mechanism for deciding its width (which has to work on regular and high DPI displays) is pretty primitive (which I know because I wrote it!). QLineEdit
is sufficient for text fields and has better built-in logic for deciding what width it should be.
(From a quick look, I already did these two fields in Brewken, but didn't yet port it back to Brewtarget.)
Alternatively, we could try to make BtLineEdit smarter about giving width hints to Qt or see if we can remove all its hints and get it to behave the same as QLineEdit with regards to layout.
Alternatively, we could try to make BtLineEdit smarter about giving width hints to Qt or see if we can remove all its hints and get it to behave the same as QLineEdit with regards to layout.
If BtLineEdit is used mostly for units, not a big deal if it can't stretch. I think using more appropriate widget is best approach.
I would prefer to make BtLineEdits smarter. Frankly, they should just be inheriting from QLineEdit on most things.
I really like consistency. Please do not ask me to think "Do I need a QLineEdit here, or a BtLineEdit", because I promise I will get it wrong.
Having looked at it, the reason it doesn't expand is I am building those grids in code and it's not always obvious how the parameters interplay.
There are any number of places in the code where the BtLineEdit does expand correctly. BtLineEdit inherits from QLineEdit and really just overrides the display methods. Everything else should work for a BtLineEdit as it does for a QLineEdit.
Let me see if I can make some sense of this.
I have a fix for this, but it is cascading into something larger. Give me a day or three and then I will discuss the PR.
Closed in #575
Edits for folders on Database tab in Options don't stretch out (at least in Windows).
This elements are created in code and due lack of experience I couldn't manage how to make them stretch like other elements, that were created in QTCreator. setSizePolicy and setMaximumLength don't work for me.