0
votes

I have QScrollArea with a lot of buttons (or other widgets) created at runtime. The idea is that scroll area has only vertical scrollbar. If some widget can't fit in current line/row then it jump to next line/row. It should work like "word wrap". I can't show picture example, but lets say that you have web browser or better QPlainTextEdit. If it contains a big text and you change its size, then words are wrapped vertically. I need similar solution with QScrollArea and childs widgets. I'm playing with Frame and Grid layout properties but can't find solution.

Regards

1

1 Answers

0
votes

As far as I know there is no way to do that with default layouts. You should implement this layout manually. You can use QVBoxLayout that contain many QHBoxLayout each of them represents a row of widgets. You can use sizeHint() of item widgets and the total size of container to determine the row number for each widget.