PySide6 layout issue
-
I am currently working on an app that displays stories stored in a database. I am in the process of designing the user interface and have created a prototype in PowerPoint PowerPoint .
The layout consists of a scroll area as the parent container, followed by a horizontal layout where multiple vertical layouts (or "columns") are placed. However, I am facing a challenge in maintaining a consistent vertical spacing of approximately 10px between each column.
The code I've tested so far has resulted in either the widgets becoming too short or the spacing becoming distorted when calculated based on the tallest widget's height . This leads to an excessive amount of spacing when there are shorter widgets present.See my amazing spaghetti like code here and here
my first thought is that the order in wich the widgets are added to the horizontal layout because to add the widgets correctly the layout needs the size of them but as they are not shown then the size given by sizehint is wrong most of the time at least until they are shown.
Any suggestions or solutions would be greatly appreciated.
-
Hi and welcome to devnet,
You might be interested in the Flow Layout example.