Multiline text input
So as far as I can see QTextEdit is the only way to do a multiline input box?
But I'm having two issues with using it in this context. I set it up with both scroll bars always disabled and tab to change focus, also disallowing rich text:
The first major problem here is that when you start entering text beyond the bounds of the widget it emits the 'alert' sound for every character entered. I assume this has something to do with the scroll bars being off, but how do you prevent it?
The second issue is the lack of a way to limit the character input. I can truncate the string on the focusOut event, or mess around with keyPressed or textChanged.. Is there a 'best' way to manage it?
Really all I want is a QLineEdit which can hold multiple lines and trying to make QTextEdit behave that way.
I ran a test using QPlainTextEdit (probably a better choice then QTextEdit in this case).
I disabled the scroll bars. For the two tests I ran the option to wrap text was left at the default and also set to no wrap.
I didn't see the alert problem you describe. There was no alert sound created or any other indication of a problem. I made sure to enter text beyond what the control could display.
With word wrap enabled the text is automatically shuffled to the next line. The control scrolled vertically when more text was entered than could be handled (no scroll bars appeared).
Without wrap the text continues to the right until a CR is entered. No scroll bar appeared but the control scrolled the contents to show the last entered characters.
Maybe you have this control sub classed in some way or there is some other option set causing the alerts?
For limiting text input you can't do it the same way you could with a QLineEdit. At some point you do read the text from the control so it could be done here.
I tested using QPlainTextEdit in place of QTextEdit and it works as you describe. So seems to be something that QTextEdit does...