[PyQt] pyuic4 does not generate alignment for LayoutItem in grid layout?

Johoski, Timothy R timothy.r.johoski at intel.com
Tue Jul 23 19:26:22 BST 2013


Hi, in Qt designer, I added a push button into a grid layout, right-clicked on that widget and chose Layout Alignment->Top.  Qt designer correctly shows the button aligned to the top.  However, pyuic4's generated code does not set the alignment for the button.  I'm thinking pyuic4 should pass the alignment as the last argument to QGridLayout.addWidget?  I am currently working around this by explicitly setting the alignment on the LayoutItems in my code, but I suspect that pyuic4 should be doing this for me?

In the following snapshots, notice that the "Aliases:" and "Browse..." widgets are aligned to the top in Qt designer, but in the middle in the generated code.

Qt designer's view:  https://www.dropbox.com/s/ex8edlskvh1uep3/DesignerSnapshot.jpg
pyuic4 generated result:  https://www.dropbox.com/s/8vrhbvjiaw8qlrz/pyuic4PreviewSnapshot.jpg

ui file:  https://www.dropbox.com/s/ynvjn8e4nbtt69o/LayoutItemAlignmentIssue.ui
pyuic4 generated code:  https://www.dropbox.com/s/byn51xuj4qd58mq/ui_LayoutItemAlignmentIssue.py

My versions:
  - Windows 7, Linux SLES 10
  - PyQt4-4.10.1
  - Python-2.7.4

Thanks, Tim


More information about the PyQt mailing list