PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1040 - pyside-uic overwriting attributes before they are being used
: pyside-uic overwriting attributes before they are being used
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: pyside-tools
: 1.0.8
: PC Linux
: P3 normal
Assigned To: Lauro Moura
:
:
:
  Show dependency treegraph
 
Reported: 2011-10-31 01:30 EET by bbreslauer
Modified: 2012-01-02 21:44 EET (History)
8 users (show)

See Also:


Attachments
Qt UI file (3.14 KB, application/x-designer)
2011-10-31 01:30 EET, bbreslauer
Details
compiled python file (3.60 KB, text/x-python)
2011-10-31 01:31 EET, bbreslauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bbreslauer 2011-10-31 01:30:44 EET
Created attachment 440 [details]
Qt UI file

If you run pyside-uic on the attached table.ui file (which creates the attached
table.py file, except for the main bit at the end to initialize it), and run
the script, you notice that the background color does not appear in cells 2, 3,
and 4 (if you compile to C++, or preview the ui in Qt Designer, then you'll see
that the background color should be red in all cells). This is due to a bug in
how the QBrushes are created by pyside-uic. When a background and foreground
brush are created, they are created at the same time, with the same name (lines
43-46 of table.py). This effectively assigns the foreground brush to the
background as well as the foreground.

The native Qt ui compiler gets around this by indexing every named item (so,
the brush names would be brush, brush1, brush2, etc). I could see that as a
possible solution, or calling setBackground before the foreground brush is
created. But I think the first method is much more robust, as I suspect that
this bug is not limited to QTableWidgetItems.
Comment 1 bbreslauer 2011-10-31 01:31:15 EET
Created attachment 441 [details]
compiled python file
Comment 2 Willer Moreira 2011-12-14 20:37:17 EET
Fixed in commit: pyside-tools/e9df59462198429d2bac013028b72393a233a126

Thanks for the report.