4

I want to show some text in a QToolButton derived class but it needs to be word wrapped. I would like to do it in an "automatic" way (instead of using \n when needed) just as one can do it when using QLabel and setting word wrapp to true, but I couldn't find anything on Qt Assistant that would do that for me.

So, is it possible? And how is it done? If there is nothing like word wrapping for QToolButton, how could I get around this without using "hard code layout" (that is, \n)?

Momergil
  • 2,213
  • 5
  • 29
  • 59
  • 1
    possible duplicate of [Is there a way to enable word wrapping of text on some simple widgets like QPushButton?](http://stackoverflow.com/questions/8969086/is-there-a-way-to-enable-word-wrapping-of-text-on-some-simple-widgets-like-qpush) – Bowdzone Jun 21 '15 at 20:42
  • 2
    @Bowdzone No, it's not duplicate. That answer proposes manual "\n" insertion, while this question clearly asks for automatic word wrapping. – Pavel Strakhov Jun 22 '15 at 11:30
  • 1
    Yes but it also suggests [this method](http://stackoverflow.com/questions/8960233/subclassing-qlabel-to-show-native-mouse-hover-button-indicator/8960548#8960548) in the comments because there does not seem to be an easier way. – Bowdzone Jun 22 '15 at 12:35

0 Answers0