Make QFormLayouts inside multiple QGroupboxes have the same column widths
I have a dialog in qt that has multiple groupboxes, each using a form layout. Something like this: https://dl.dropbox.com/u/4494367/Groupbox_Layouts.png
Is the开发者_C百科re a way to get the form layouts to link, so that the have the same column widths?
There is no built in way to do this but three possibilities come to mind:
- Manually set the minimum width on all your labels to a value that will accommodate the longest of all of your labels (not flexible). Suggested here in a similar question.
- A variation of the above would be to try to query the size hints to find the largest label and then set the minimum widths on all your labels based on that. This suggestion comes from an answer to another similar question here.
- Write a custom layout that might do something similar to the above.
You may want to browse the linked questions for other info but I think it is generally agreed that this objective may not be entirely worth the effort :)
精彩评论