-
-
Notifications
You must be signed in to change notification settings - Fork 311
How to prevent text wrapping in QPlainTextEdit? #82
Description
I have a QPlainTextEdit on which I wish to display a random combination of letters, numbers and special characters (a password, basically).
When the text is only letters and numbers, the output runs from left to right with no breaks (as one would expect). It only wraps when it hits the edge of the QPlainTextEdit.
passOutput.setPlainText(
'AS0dlkqVDmC5L8mKhNAmVU7Ww2j9LiCFo6k43uR6lngZ0Prr2I1xRF7Y64PF92j87V'
);However, if the text contains certain special characters an undesired line break is inserted. E.g.:
passOutput.setPlainText(
'2VB#t>ZQyS.*|t`=t=AdB=s9gyNKt%Up9q:fKpL]DKB-5:g),cneAg4(bH:A9hF/cH'
);
Notice the line break after the | character.
My question: is there any way to prevent this?
I would like the text containing the special characters to run from left to right and only wrap when the edge of the QPlainTextEdit is reached (like the example containing just letters and numbers).
I tried styling the QPlainTextEdit using word-break: break-all, but it didn't make a difference.
Looking through the QT docs, I did find this: https://doc.qt.io/qt-5/qtextoption.html#WrapMode-enum
Is something like wrap mode available in NodeGUI?

