Wrapping a word/text with a hyphen
Unsolved
General and Desktop
-
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 -
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