[PySide] pyside-uic rename QtDesigner

Aaron Richiger a.richi at bluewin.ch
Thu Apr 25 10:41:27 CEST 2013


Hello Al!

I tried to reproduce this, but failed, pyside-uic didn't generate 
invalid code for me (but incorrect code, see below). Could you please 
show us the output of
pyside-uic --version

On my Ubuntu 12.10, I got pyside-uic via apt-get and got the following 
output:
PySide User Interface Compiler version 0.2.13, running on PySide 1.1.1.

Interesting side mark: The generated python code wasn't correct:

Input:

<layout class="QGridLayout" name="gridLayout">
     <property name="margin">
         <number>20</number>
     </property>
</layout>

Compiled to:

         self.gridLayout.setContentsMargins(20, 20, 20, 20)
         self.gridLayout.setContentsMargins(0, 0, 0, 0)

So, initially, the margins are set as expected, but they get reset 
directly after!?
Is this bug fixed in newer versions of pyside-uic?

To reproduce it:
- open Qt4Designer
- New ui project for Widget
- drag and drop a gridlayout into it and add some pushbuttons to it
- Change the margins to some value >0 in the property editor on the 
right side of Qt4Designer
- Save it as test.ui
- Translate it to python code with: pyside-uic -o ui.py -x test.ui
- Run the example: python ui.py

Cheers!
Aaron



Am 25.04.2013 09:25, schrieb Algis Kabaila:
>
> That was a badly chosen subject. Clearly, the QtDesigner produces a 
> code that appears to require to use setMargin. Part of the 
> calculatorform.ui file is as follows:
>
> <string>Calculator Form</string>
>
> </property>
>
> <layout class="QGridLayout">
>
> <property name="margin">
>
> <number>9</number>
>
> So as I can not make head or tail of the documentation, where did I 
> slip up?
>
> High marks to "Spyder" - in spite of my inability of getting the 
> version number of it :)
>
> Al.
>
> On Thursday 25 April 2013 16:59:57 Algis Kabaila wrote:
>
> Hi,
>
> Aaron Richiger had kindly indicated where the pyside-examples "live". 
> There seems to be very few examples that use QtDesigner. From my 
> perspective of GUI programming, QtDesigner is a major attraction.
>
>
>
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130425/d9a295bb/attachment.html>


More information about the PySide mailing list