Skip to content

Add a rectangular grid layout for adding new widgets

Magne.Stromsnes requested to merge use_gridlayout into master

This appends widgets into a grid that is largely rectangular and automatically adds and removes rows as needed.

The simple mechanism has some quirks when adding and removing widgets when it completes a rectangle, allowing you to grow wider rectangles rather than keep it square. The behaviour is not intuitive there.

As QGridLayout likes to add rows and columns as it pleases, manually doing it with QVBox and QHBox is done instead.

This also fixes the memory leak documented here: https://mitt.uib.no/courses/33546/discussion_topics/302836 That is, hiding the widget removes it from renderwidgets, never letting us unhide it.

Merge request reports