add_n_buttons#
- CommonWindowUtils.add_n_buttons(layout=None, num_buttons=1, height=40, width=[200], text=['button'], font_size=10)[source]#
Add a specified number of buttons to a layout object.
- Parameters:
- layout: QLayout, optional
The layout to which the buttons will be added. If None, a new QHBoxLayout will be created.
- num_buttons: int, optional
The number of buttons to be added to the layout. Default is 1.
- height: int, optional
The height of the buttons. Default is 40.
- width: list of int, optional
The widths of the buttons. If list length is less than num_buttons, all buttons take the same width. Default is [200].
- text: list of str, optional
The texts to be displayed on the buttons. If list length is less than num_buttons, all buttons display the same text. Default is [‘button’].
- font_size: float or int, optional
Font size. Default is
10
.
- Returns:
list
A list containing the layout row object and the button objects.