[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] pyuic4 does not generate alignment for LayoutItem in grid layout?
From: "Johoski, Timothy R" <timothy.r.johoski () intel ! com>
Date: 2013-07-28 1:04:52
Message-ID: 6A6C81C6EE0AD649BEC0D14FB78818CD6B81DE46 () ORSMSX107 ! amr ! corp ! intel ! com
[Download RAW message or body]
>
> On Tue, 23 Jul 2013 18:26:22 +0000, "Johoski, Timothy R"
> <timothy.r.johoski@intel.com> wrote:
> > 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
>
>
> From: Phil Thompson
> Sent: Friday, July 26, 2013 1:41 AM
>
> Fixed in tonight's snapshots.
>
> Thanks,
> Phil
hi Phil, thanks for the quick fix. I finally got around to trying it
out and it works great for cases where I'm setting either Horizontal
or Vertical layout alignment, but when I set both, pyuic4 encounters
an error. I glanced through the diff of the snapshot and made a hacky
fix in my copy of uiparser.gridPosition() which is now working fine
for me, you can find it here:
https://www.dropbox.com/s/ixe9rrl5dqytn1v/uiparser.gridPosition.py
I'm a newbie to this stuff, so probably you'll know a better way to
implement the OR'ing of alignments...
In case you'd like a test case, I updated the example ui file here to set
both horizontal and vertical alignments:
https://www.dropbox.com/s/ynvjn8e4nbtt69o/LayoutItemAlignmentIssue.ui
Thanks much,
Tim
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic