[PyQt] Layout addWidget alignment

Baz Walter bazwal at ftml.net
Wed Jul 1 19:07:42 BST 2015


On 01/07/15 17:40, Esteban Martinena Guerrero wrote:
> Hi,
>
> The addWidget method of the Layouts accepts 3 arguments. If you set the
> alignment for any widget in a layout tf would be the third argument of the
> addWidgetMethod but it's in the second one. This doen't generate any errors
> because the second and third parameters are both optional and integers.
>
> Can anyone tell me if you have the same problem?

What problem? Either of:

     layout.addWidget(widget, 0, Qt.AlignCenter)

or:

     layout.addWidget(widget, alignment=Qt.AlignCenter)

work exactly as expected for me.

-- 
Regards
Baz Walter


More information about the PyQt mailing list