Turns out I didn't need the gridlayout library after all.