View Single Post
Old 05-22-2018, 05:16 PM   #21
Fuzzi
Member
Fuzzi began at the beginning.
 
Posts: 10
Karma: 10
Join Date: May 2018
Device: Kobo Glo HD
Hey,
got an answer from the Qt guys:
Quote:
Originally Posted by Qt
You mean you want it to dynamic word wrap and not use \n for it ?

setMaximumWidth already exists but for the word wrap, you would have to make a custom QToolButton and handle it yourself. Also you might need to
override sizeHint() too as as far as i recall it looks at the text and will be unaware if
you word wrap it in paintEvent.
So...
To prevent that workaround and not overcomplicate it, I consider it an appropriate solution to hardcode the wordwraps and define a minWidth to approximate the width for all buttons.

Last edited by Fuzzi; 05-22-2018 at 05:17 PM. Reason: typo
Fuzzi is offline   Reply With Quote