I have a layout where there are a large number of widgets with different shapes and sizes, all laid out in a two-dimensional grid. They look better when laid out in a QGridLayout than if I were to use a QTableView, and yet it would still be helpful to have some horizontal and vertical lines drawn at strategic locations to help guide the eye. Is there a convenient way of doing this?

For example, what I'd really like to be able to do is to take my layout with four columns and about 15 rows, and draw a vertical line between each column and horizontal lines at intervals of every three or four rows.

I have an inkling that it may be possible to do with style sheets - certainly, that's how I'd do it if I wanted to shade the cells differently rather than drawing lines between them - but I've never really got the hang of these and I'm wondering if there is a simpler way.

Thanks,
Stephen.