is there a way to configure QHBoxLayout, so when the added widgets(different in width) reach the end of the line, they would be added to a new line? How would you even detect if the last added widget crosses the end of the line?
Asked
Active
Viewed 1,634 times
1 Answers
2
You can't do that with a QHBoxLayout
, since there isn't the concept of "new line".
You can manually adjust a QGridLayout
. You can see this related question on SO.
Or you can use the Qt FlowLayout
. It's not a built-in layout, but in Qt FlowLayout Example you can find an example with the implementation.