[PySide] QDialogButtonBox

Tim Roberts timr at probo.com
Tue May 22 02:30:17 CEST 2018


Frank Rueter | OHUfx wrote:
> I am trying to use a QHBoxLayout with a checkbox and a
> QDialogButtonBox in it.
>
> ...
>
> However, the alignment for the checkbox is ignores and it ends up all
> the way on the left:
>
>
> I'd like it to be next to the Cancel button though.
> I tried this with a different widget than QDialogButtonBox and I get
> the expected result.
> I then tried setting the sizePolicy of the button box to "minimum" but
> to no avail.

Surprisingly, it IS moving it all the way to the right, but because it
is resizable, it's stretching the size so that it reaches to the left
margin.

The usual way to solve this is to add a QSpacerItem on the left.  That
way, the spacer item stretches to fill the space.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20180521/6fc93364/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kjadmacdbemhfnne.png
Type: image/png
Size: 23858 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20180521/6fc93364/attachment.png>


More information about the PySide mailing list