Wrapping a word/text with a hyphen
-
Hi,
I am using "setWordWrapMode(QTextOption::WrapAnywhere)" in a QTextBrowser to signal the text wrap mode. The wrapping works fine but I've got no hyphen (-) at the end of a text line. Is there a way to set the word wrapping mode to enable a hyphen at lineend?
Thanks a lot and best regards
Lukas -
-
No, I dont putting my own hyphen. It currently just wraps a word at the line end without a hyphen. What I want to have (if possible) is to force Qt to insert a hyphen at the correct word position for hyphenation at a linened.
-
Hi @LukasGin and welcome
I don't think there is a predefined way to add a hyphen and the end of a line, when a word was split.
I only thing I can think of to archive this, is to make your own widget and override paintEvent and add a hyphen in the needed places.
Take a look at this elided label example, where there's done something similar
https://doc.qt.io/qt-5/qtwidgets-widgets-elidedlabel-example.html -
Ok, thanks a lot!
2/5